fix(actions): use Chinese workflow filenames
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
name: 回退生产环境 Nacos 配置
|
||||
|
||||
"on":
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
snapshot_id:
|
||||
description: 可选快照 ID,留空使用待回退快照
|
||||
required: false
|
||||
type: string
|
||||
auto_rollback:
|
||||
description: 是否由自动失败流程触发
|
||||
required: false
|
||||
type: boolean
|
||||
|
||||
concurrency:
|
||||
group: release-prod
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
rollback:
|
||||
runs-on: jayucloud
|
||||
container:
|
||||
options: >-
|
||||
-v /opt/software/panel/apps/gitea/act_runner/salon-release:/salon-release
|
||||
env:
|
||||
NACOS_ENVIRONMENT: prod
|
||||
RELEASE_STORE_ROOT: /salon-release
|
||||
NACOS_SNAPSHOT_ID: ${{ inputs.snapshot_id }}
|
||||
NACOS_PROD_URLS: ${{ secrets.NACOS_PROD_URLS }}
|
||||
NACOS_PROD_USERNAME: ${{ secrets.NACOS_PROD_USERNAME }}
|
||||
NACOS_PROD_PASSWORD: ${{ secrets.NACOS_PROD_PASSWORD }}
|
||||
NACOS_DR_URLS: ${{ secrets.NACOS_DR_URLS }}
|
||||
NACOS_DR_USERNAME: ${{ secrets.NACOS_DR_USERNAME }}
|
||||
NACOS_DR_PASSWORD: ${{ secrets.NACOS_DR_PASSWORD }}
|
||||
AUTO_ROLLBACK: ${{ inputs.auto_rollback }}
|
||||
GITHUB_SERVER_URL: http://192.168.5.15:3000
|
||||
steps:
|
||||
- name: 检出回退脚本
|
||||
shell: bash
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GITHUB_SERVER_URL: http://192.168.5.15:3000
|
||||
run: |
|
||||
git init .
|
||||
git remote add origin "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git"
|
||||
git -c http.extraheader="Authorization: token $GITEA_TOKEN" fetch --no-tags --depth=1 origin "$GITHUB_SHA"
|
||||
git checkout --detach "$GITHUB_SHA"
|
||||
- name: 恢复并校验 Nacos
|
||||
shell: bash
|
||||
run: AUTO_ROLLBACK=${AUTO_ROLLBACK:-false} node .gitea/scripts/rollback-nacos.mjs
|
||||
- name: 触发 PROD 应用恢复
|
||||
if: inputs.auto_rollback == true
|
||||
shell: bash
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
AUTO_ROLLBACK: 'true'
|
||||
run: node .gitea/scripts/dispatch-workflow.mjs prod环境回退上一个版本.yml refs/heads/prod
|
||||
Reference in New Issue
Block a user