From 7bb44ba9bf6125d30dfa52f5d3cfae764d8211d5 Mon Sep 17 00:00:00 2001 From: Emanuele Paolini Date: Thu, 22 Feb 2024 11:20:12 +0100 Subject: [PATCH] action for automatic restart --- .github/workflows/main.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..6b9e6b0 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,21 @@ +name: Restart Monitor + +on: + push: + branches: + - main +jobs: + production: + runs-on: ubuntu-latest + steps: + - name: Setup SSH + run: | + mkdir -p ~/.ssh/ + echo "${{ secrets.SSH_PRIV_KEY }}" > ~/.ssh/id_rsa + echo "${{ secrets.SSH_PUB_KEY }}" > ~/.ssh/id_rsa.pub + chmod 600 ~/.ssh/id_rsa + chmod 600 ~/.ssh/id_rsa.pub + ssh-keyscan -H ${{ secrets.HOSTNAME }} >> ~/.ssh/known_hosts + - name: restart server + run: | + ssh radxa@${{ secrets.HOSTNAME }} ./start-schermo.sh