diff --git a/.forgejo/main.yml b/.forgejo/main.yml new file mode 100644 index 0000000..89ebfa5 --- /dev/null +++ b/.forgejo/main.yml @@ -0,0 +1,23 @@ +name: Restart Website Service + +on: + push: + branches: + - main # Change this to the branch you want to trigger the action on + +jobs: + restart_service: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Restart website service + env: + SSH_PRIVATE_KEY: ${{ secrets.WEBSITE_KEY }} # Store your private key in secrets + run: | + echo "$SSH_PRIVATE_KEY" > private_key + chmod 600 private_key + ssh -i private_key website-host-user@spoodythe.one -t 'systemctl restart website.service' +