use github actions again
This commit is contained in:
parent
8330566080
commit
62e0c554df
1 changed files with 7 additions and 18 deletions
25
.github/workflows/deploy.yml
vendored
25
.github/workflows/deploy.yml
vendored
|
|
@ -8,21 +8,10 @@ jobs:
|
||||||
deploy:
|
deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Trigger deploy webhook
|
- name: Deploy via SSH
|
||||||
env:
|
uses: appleboy/ssh-action@v1
|
||||||
WEBHOOK_SECRET: ${{ secrets.WEBHOOK_SECRET }}
|
with:
|
||||||
run: |
|
host: love-tin.exe.xyz
|
||||||
# Build the payload
|
username: exedev
|
||||||
PAYLOAD='{"ref":"refs/heads/master","pusher":{"name":"github-actions"}}'
|
key: ${{ secrets.DEPLOY_SSH_KEY }}
|
||||||
|
script: /home/exedev/deploy.sh
|
||||||
# Compute HMAC signature
|
|
||||||
SIGNATURE="sha256=$(echo -n "$PAYLOAD" | openssl dgst -sha256 -hmac "$WEBHOOK_SECRET" | awk '{print $2}')"
|
|
||||||
|
|
||||||
# Send webhook
|
|
||||||
curl -sf -X POST \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
-H "X-Hub-Signature-256: $SIGNATURE" \
|
|
||||||
-d "$PAYLOAD" \
|
|
||||||
https://love-tin.exe.xyz:9000/deploy
|
|
||||||
|
|
||||||
echo "Deploy triggered successfully"
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue