Switch deploy to webhook-based approach
exe.dev SSH proxy blocks direct SSH from GitHub Actions. Use webhook listener on port 9000 instead. Co-authored-by: Shelley <shelley@exe.dev>
This commit is contained in:
parent
133a0ce50f
commit
a6e763c153
1 changed files with 18 additions and 7 deletions
25
.github/workflows/deploy.yml
vendored
25
.github/workflows/deploy.yml
vendored
|
|
@ -8,10 +8,21 @@ jobs:
|
|||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Deploy via SSH
|
||||
uses: appleboy/ssh-action@v1
|
||||
with:
|
||||
host: love-tin.exe.xyz
|
||||
username: exedev
|
||||
key: ${{ secrets.DEPLOY_SSH_KEY }}
|
||||
script: /home/exedev/deploy.sh
|
||||
- name: Trigger deploy webhook
|
||||
env:
|
||||
WEBHOOK_SECRET: ${{ secrets.WEBHOOK_SECRET }}
|
||||
run: |
|
||||
# Build the payload
|
||||
PAYLOAD='{"ref":"refs/heads/master","pusher":{"name":"github-actions"}}'
|
||||
|
||||
# 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