ci: add deploy-agent workflow triggered on deploy/agent branch (#37496)

This commit is contained in:
Bond Zhu 2026-06-16 15:35:48 +08:00 committed by GitHub
parent b6b9165d2b
commit f53d7d4287
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

28
.github/workflows/deploy-agent.yml vendored Normal file
View File

@ -0,0 +1,28 @@
name: Deploy Agent
permissions:
contents: read
on:
workflow_run:
workflows: ["Build and Push API & Web"]
branches:
- "deploy/agent"
types:
- completed
jobs:
deploy:
runs-on: depot-ubuntu-24.04
if: |
github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.head_branch == 'deploy/agent'
steps:
- name: Deploy to server
uses: appleboy/ssh-action@0ff4204d59e8e51228ff73bce53f80d53301dee2 # v1.2.5
with:
host: ${{ secrets.AGENT_SSH_HOST }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
${{ vars.SSH_SCRIPT_AGENT || secrets.SSH_SCRIPT_AGENT }}