diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..bc3b25d --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,13 @@ +name: Deploy to VPS + +on: workflow_call + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Trigger Watchtower on VPS + env: + WATCHTOWER_TOKEN: ${{ secrets.WATCHTOWER_TOKEN }} + run: | + curl -H "Authorization: Bearer $WATCHTOWER_TOKEN" https://watchtower.lnkshrt.xyz/v1/update diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2c8bc5d..224165f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,3 +21,9 @@ jobs: with: REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} + + deploy: + if: github.ref == 'refs/heads/main' + needs: build-and-push + uses: ./.github/workflows/deploy.yml + secrets: inherit