Files
JayuCloud/.gitea/workflows/回退dev环境nacos配置.yml
T
xiaowang 3ad792115c
环境分支晋级检查 / environment-promotion-source (pull_request_target) Successful in 1s
自动发布开发环境 Nacos 配置 / publish (push) Successful in 29s
fix(actions): use Chinese workflow filenames
2026-10-16 14:48:49 +08:00

47 lines
1.5 KiB
YAML

name: 回退开发环境 Nacos 配置
"on":
workflow_dispatch:
inputs:
snapshot_id:
description: 可选快照 ID,留空使用待回退快照
required: false
type: string
auto_rollback:
description: 是否由自动失败流程触发
required: false
type: boolean
concurrency:
group: release-dev
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: dev
RELEASE_STORE_ROOT: /salon-release
NACOS_SNAPSHOT_ID: ${{ inputs.snapshot_id }}
NACOS_DEV_URLS: ${{ secrets.NACOS_DEV_URLS }}
NACOS_DEV_USERNAME: ${{ secrets.NACOS_DEV_USERNAME }}
NACOS_DEV_PASSWORD: ${{ secrets.NACOS_DEV_PASSWORD }}
AUTO_ROLLBACK: ${{ inputs.auto_rollback }}
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