tachybase_todo/.github/workflows/auto_down_deploy_pr.yml
lyf-coder c94f29a8ce
ci(workflows): support manual depoly and stop pr (#1132)
* ci(workflows): support manual depoly and stop pr

* ci(workflows): support auto depoly pr and stop pr

* ci(workflows): depoly pr script moves to server side

* ci(workflows): support pr sent text msg to feishu bot

* ci(workflows): fix auto deploy pr script

* ci(workflows): support auto deploy main and develop branch
2022-11-30 16:10:12 +08:00

33 lines
873 B
YAML

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:
nocobase_deploy_sh: /home/ecs-user/nocobase/auto-deploy-pr/nocobase-deploy.sh
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: |
${{ env.nocobase_deploy_sh }} down ${{ env.pr_number }}