2022-11-30 08:10:12 +00:00
|
|
|
name: Auto down deploy
|
|
|
|
# deploy_host
|
|
|
|
# deploy_host_username
|
|
|
|
# deploy_host_password
|
|
|
|
|
|
|
|
# https://docs.github.com/cn/actions/using-workflows/events-that-trigger-workflows#workflow_run
|
|
|
|
env:
|
2022-11-30 08:49:12 +00:00
|
|
|
nocobase_deploy_sh_dir: /home/ecs-user/nocobase/auto-deploy-pr/
|
2022-11-30 08:10:12 +00:00
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
types:
|
|
|
|
- closed
|
|
|
|
branches:
|
|
|
|
- '**'
|
|
|
|
paths:
|
|
|
|
- 'packages/**'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
down_deploy:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: ssh down deploy
|
|
|
|
if: github.event.pull_request.merged == true
|
|
|
|
uses: appleboy/ssh-action@master
|
|
|
|
env:
|
|
|
|
pr_number: ${{ github.event.number }}
|
|
|
|
with:
|
|
|
|
host: ${{ secrets.deploy_host }}
|
|
|
|
username: ${{ secrets.deploy_host_username }}
|
|
|
|
password: ${{ secrets.deploy_host_password }}
|
|
|
|
script: |
|
2022-11-30 08:49:12 +00:00
|
|
|
cd ${{ env.nocobase_deploy_sh_dir }}
|
|
|
|
./nocobase-deploy.sh down ${{ env.pr_number }}
|