mirror of
https://git.bjxgj.com/xgj/xgj-actions.git
synced 2025-10-14 06:33:37 +08:00
fix: 更新 cache-state 示例文件,修正 GitHub Action 使用路径,从 .actions/xgj/cache-state@v1 修改为 actions/xgj/cache-state@v1,以确保正确引用和执行缓存状态管理功能。
This commit is contained in:
@@ -20,7 +20,7 @@ jobs:
|
||||
|
||||
- name: 获取或设置应用版本
|
||||
id: app-version
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'application-version'
|
||||
state-value: ${{ github.event.inputs.version }}
|
||||
@@ -45,7 +45,7 @@ jobs:
|
||||
fi
|
||||
|
||||
- name: 记录构建状态
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'last-build-status'
|
||||
state-value: 'success'
|
||||
@@ -53,7 +53,7 @@ jobs:
|
||||
|
||||
- name: 获取构建历史
|
||||
id: build-history
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'build-count'
|
||||
state-value: '1'
|
||||
@@ -68,7 +68,7 @@ jobs:
|
||||
echo "新的构建次数: ${NEW_COUNT}"
|
||||
|
||||
- name: 保存新的构建计数
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'build-count'
|
||||
state-value: ${{ env.NEW_COUNT }}
|
||||
|
@@ -35,7 +35,7 @@ jobs:
|
||||
|
||||
- name: 获取环境配置
|
||||
id: env-state
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'target-environment-${{ github.ref_name }}'
|
||||
state-value: ${{ github.event.inputs.environment || 'staging' }}
|
||||
@@ -44,7 +44,7 @@ jobs:
|
||||
|
||||
- name: 检查上次部署的SHA
|
||||
id: last-deploy
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'last-deployed-sha-${{ steps.env-state.outputs.state-value }}'
|
||||
default-value: 'none'
|
||||
@@ -52,7 +52,7 @@ jobs:
|
||||
|
||||
- name: 检查部署状态
|
||||
id: deploy-status
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'deploy-status-${{ steps.env-state.outputs.state-value }}'
|
||||
default-value: 'idle'
|
||||
@@ -96,14 +96,14 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: 标记部署开始
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'deploy-status-${{ needs.check-deployment-state.outputs.environment }}'
|
||||
state-value: 'deploying'
|
||||
action: 'set'
|
||||
|
||||
- name: 记录部署开始时间
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'deploy-start-time-${{ needs.check-deployment-state.outputs.environment }}'
|
||||
state-value: ${{ github.run_started_at }}
|
||||
@@ -124,7 +124,7 @@ jobs:
|
||||
|
||||
- name: 记录成功部署的SHA
|
||||
if: success()
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'last-deployed-sha-${{ needs.check-deployment-state.outputs.environment }}'
|
||||
state-value: ${{ github.sha }}
|
||||
@@ -132,7 +132,7 @@ jobs:
|
||||
|
||||
- name: 标记部署成功
|
||||
if: success()
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'deploy-status-${{ needs.check-deployment-state.outputs.environment }}'
|
||||
state-value: 'success'
|
||||
@@ -140,7 +140,7 @@ jobs:
|
||||
|
||||
- name: 记录部署完成时间
|
||||
if: success()
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'deploy-end-time-${{ needs.check-deployment-state.outputs.environment }}'
|
||||
state-value: ${{ github.event.head_commit.timestamp }}
|
||||
@@ -148,7 +148,7 @@ jobs:
|
||||
|
||||
- name: 标记部署失败
|
||||
if: failure()
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'deploy-status-${{ needs.check-deployment-state.outputs.environment }}'
|
||||
state-value: 'failed'
|
||||
@@ -156,7 +156,7 @@ jobs:
|
||||
|
||||
- name: 记录失败信息
|
||||
if: failure()
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'deploy-error-${{ needs.check-deployment-state.outputs.environment }}'
|
||||
state-value: 'Deployment failed at ${{ github.event.head_commit.timestamp }}'
|
||||
@@ -169,7 +169,7 @@ jobs:
|
||||
steps:
|
||||
- name: 获取最终部署状态
|
||||
id: final-status
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'deploy-status-${{ needs.check-deployment-state.outputs.environment }}'
|
||||
default-value: 'unknown'
|
||||
@@ -193,7 +193,7 @@ jobs:
|
||||
# 清理部署锁定状态(如果需要)
|
||||
- name: 清理部署锁定
|
||||
if: always()
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'deploy-status-${{ needs.check-deployment-state.outputs.environment }}'
|
||||
state-value: 'idle'
|
||||
|
@@ -45,7 +45,7 @@ jobs:
|
||||
|
||||
- name: 检查上次操作状态
|
||||
id: last-operation
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'last-operation-status'
|
||||
default-value: 'none'
|
||||
@@ -86,7 +86,7 @@ jobs:
|
||||
|
||||
- name: 记录操作开始
|
||||
if: steps.check-previous.outputs.should-continue == 'true'
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'current-operation-id'
|
||||
state-value: ${{ steps.operation-setup.outputs.operation-id }}
|
||||
@@ -95,7 +95,7 @@ jobs:
|
||||
|
||||
- name: 记录操作状态为进行中
|
||||
if: steps.check-previous.outputs.should-continue == 'true'
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'last-operation-status'
|
||||
state-value: 'running'
|
||||
@@ -112,7 +112,7 @@ jobs:
|
||||
|
||||
- name: 检查构建重试状态
|
||||
id: retry-status
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'build-retry-count-${{ needs.initialize-operation.outputs.operation-id }}'
|
||||
default-value: '0'
|
||||
@@ -160,7 +160,7 @@ jobs:
|
||||
|
||||
- name: 更新重试计数(失败时)
|
||||
if: failure()
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'build-retry-count-${{ needs.initialize-operation.outputs.operation-id }}'
|
||||
state-value: ${{ steps.prepare-retry.outputs.next-retry }}
|
||||
@@ -169,7 +169,7 @@ jobs:
|
||||
|
||||
- name: 记录构建失败状态
|
||||
if: failure()
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'build-status-${{ needs.initialize-operation.outputs.operation-id }}'
|
||||
state-value: 'failed'
|
||||
@@ -178,7 +178,7 @@ jobs:
|
||||
|
||||
- name: 记录构建失败时间
|
||||
if: failure()
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'build-failure-time-${{ needs.initialize-operation.outputs.operation-id }}'
|
||||
state-value: ${{ github.event.head_commit.timestamp }}
|
||||
@@ -187,7 +187,7 @@ jobs:
|
||||
|
||||
- name: 清理重试计数(成功时)
|
||||
if: success()
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'build-retry-count-${{ needs.initialize-operation.outputs.operation-id }}'
|
||||
state-value: ''
|
||||
@@ -196,7 +196,7 @@ jobs:
|
||||
|
||||
- name: 记录构建成功状态
|
||||
if: success()
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'build-status-${{ needs.initialize-operation.outputs.operation-id }}'
|
||||
state-value: 'success'
|
||||
@@ -213,7 +213,7 @@ jobs:
|
||||
|
||||
- name: 获取上次成功的部署版本
|
||||
id: last-deploy
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'last-successful-deployment'
|
||||
default-value: 'v1.0.0'
|
||||
@@ -221,7 +221,7 @@ jobs:
|
||||
cache-prefix: 'deploy'
|
||||
|
||||
- name: 备份当前部署状态
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'deployment-backup-${{ needs.initialize-operation.outputs.operation-id }}'
|
||||
state-value: ${{ steps.last-deploy.outputs.state-value }}
|
||||
@@ -245,7 +245,7 @@ jobs:
|
||||
|
||||
- name: 记录部署成功
|
||||
if: success()
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'last-successful-deployment'
|
||||
state-value: ${{ github.sha }}
|
||||
@@ -254,7 +254,7 @@ jobs:
|
||||
|
||||
- name: 清理备份(成功时)
|
||||
if: success()
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'deployment-backup-${{ needs.initialize-operation.outputs.operation-id }}'
|
||||
state-value: ''
|
||||
@@ -273,7 +273,7 @@ jobs:
|
||||
|
||||
- name: 记录回滚状态
|
||||
if: failure()
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'rollback-executed-${{ needs.initialize-operation.outputs.operation-id }}'
|
||||
state-value: 'true'
|
||||
@@ -313,7 +313,7 @@ jobs:
|
||||
echo "🏁 最终状态: ${FINAL_STATUS}"
|
||||
|
||||
- name: 记录最终操作状态
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'last-operation-status'
|
||||
state-value: ${{ steps.final-status.outputs.final-status }}
|
||||
@@ -321,7 +321,7 @@ jobs:
|
||||
cache-prefix: 'operation'
|
||||
|
||||
- name: 记录操作完成时间
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'last-operation-time'
|
||||
state-value: ${{ github.event.head_commit.timestamp }}
|
||||
@@ -369,7 +369,7 @@ jobs:
|
||||
# 例如,清理超过一定时间的重试计数、备份等临时状态
|
||||
|
||||
- name: 清理示例 - 重置错误计数
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'error-count-global'
|
||||
state-value: '0'
|
||||
|
@@ -41,7 +41,7 @@ jobs:
|
||||
|
||||
- name: 获取或设置功能开关状态
|
||||
id: feature-flag
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'feature-${{ github.event.inputs.feature_name }}-${{ github.event.inputs.environment }}'
|
||||
state-value: ${{ github.event.inputs.feature_enabled }}
|
||||
@@ -51,7 +51,7 @@ jobs:
|
||||
|
||||
- name: 管理灰度发布配置
|
||||
id: rollout
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'rollout-${{ github.event.inputs.feature_name }}-${{ github.event.inputs.environment }}'
|
||||
state-value: ${{ github.event.inputs.rollout_percentage }}
|
||||
@@ -60,7 +60,7 @@ jobs:
|
||||
action: 'get-or-set'
|
||||
|
||||
- name: 记录功能开关变更历史
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'feature-history-${{ github.event.inputs.feature_name }}'
|
||||
state-value: '${{ github.event.inputs.environment }}:${{ github.event.inputs.feature_enabled }}:${{ github.run_started_at }}'
|
||||
@@ -100,7 +100,7 @@ jobs:
|
||||
|
||||
- name: 获取服务特定的功能配置
|
||||
id: service-config
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'service-config-${{ matrix.service }}-${{ github.event.inputs.environment }}'
|
||||
default-value: '{"features":{},"version":"1.0"}'
|
||||
@@ -133,7 +133,7 @@ jobs:
|
||||
esac
|
||||
|
||||
- name: 更新服务配置状态
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'service-config-applied-${{ matrix.service }}'
|
||||
state-value: '${{ github.event.inputs.feature_name }}:${{ needs.manage-feature-flags.outputs.feature-state }}'
|
||||
@@ -149,7 +149,7 @@ jobs:
|
||||
|
||||
- name: 初始化功能监控指标
|
||||
id: init-metrics
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'metrics-${{ github.event.inputs.feature_name }}-${{ github.event.inputs.environment }}'
|
||||
default-value: '{"users":0,"errors":0,"performance":100}'
|
||||
@@ -175,7 +175,7 @@ jobs:
|
||||
echo "performance_score=${PERFORMANCE_SCORE}" >> $GITHUB_ENV
|
||||
|
||||
- name: 更新功能监控指标
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'metrics-${{ github.event.inputs.feature_name }}-${{ github.event.inputs.environment }}'
|
||||
state-value: '{"users":${{ env.users_count }},"errors":${{ env.error_count }},"performance":${{ env.performance_score }}}'
|
||||
@@ -202,7 +202,7 @@ jobs:
|
||||
|
||||
- name: 记录异常告警
|
||||
if: env.alert != 'none'
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'alert-${{ github.event.inputs.feature_name }}-${{ github.event.inputs.environment }}'
|
||||
state-value: '${{ env.alert }}:${{ github.run_started_at }}'
|
||||
@@ -219,7 +219,7 @@ jobs:
|
||||
|
||||
- name: 检查是否需要回滚
|
||||
id: check-rollback
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'alert-${{ github.event.inputs.feature_name }}-${{ github.event.inputs.environment }}'
|
||||
default-value: 'none'
|
||||
@@ -235,7 +235,7 @@ jobs:
|
||||
|
||||
- name: 禁用功能开关
|
||||
if: contains(steps.check-rollback.outputs.state-value, 'high_error_rate')
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'feature-${{ github.event.inputs.feature_name }}-${{ github.event.inputs.environment }}'
|
||||
state-value: 'false'
|
||||
@@ -244,7 +244,7 @@ jobs:
|
||||
|
||||
- name: 记录回滚操作
|
||||
if: contains(steps.check-rollback.outputs.state-value, 'high_error_rate')
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'rollback-${{ github.event.inputs.feature_name }}-${{ github.event.inputs.environment }}'
|
||||
state-value: 'auto-rollback:${{ github.run_started_at }}'
|
||||
@@ -270,7 +270,7 @@ jobs:
|
||||
|
||||
- name: 获取最终功能状态
|
||||
id: final-state
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'feature-${{ github.event.inputs.feature_name }}-${{ github.event.inputs.environment }}'
|
||||
action: 'get'
|
||||
@@ -278,7 +278,7 @@ jobs:
|
||||
|
||||
- name: 获取监控指标
|
||||
id: final-metrics
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'metrics-${{ github.event.inputs.feature_name }}-${{ github.event.inputs.environment }}'
|
||||
action: 'get'
|
||||
@@ -286,7 +286,7 @@ jobs:
|
||||
|
||||
- name: 检查回滚历史
|
||||
id: rollback-check
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'rollback-${{ github.event.inputs.feature_name }}-${{ github.event.inputs.environment }}'
|
||||
default-value: 'none'
|
||||
@@ -318,7 +318,7 @@ jobs:
|
||||
# 例如,清理超过一定时间的开发环境功能开关
|
||||
|
||||
- name: 重置开发环境告警
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'dev-alerts-cleared'
|
||||
state-value: '${{ github.run_started_at }}'
|
||||
|
@@ -50,7 +50,7 @@ jobs:
|
||||
esac
|
||||
|
||||
- name: 保存环境副本数配置
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'replicas-${{ matrix.environment }}'
|
||||
state-value: ${{ steps.env-config.outputs.replicas }}
|
||||
@@ -58,7 +58,7 @@ jobs:
|
||||
cache-prefix: 'env-config'
|
||||
|
||||
- name: 保存环境资源配置
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'resources-${{ matrix.environment }}'
|
||||
state-value: ${{ steps.env-config.outputs.resources }}
|
||||
@@ -66,7 +66,7 @@ jobs:
|
||||
cache-prefix: 'env-config'
|
||||
|
||||
- name: 保存调试模式配置
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'debug-${{ matrix.environment }}'
|
||||
state-value: ${{ steps.env-config.outputs.debug }}
|
||||
@@ -75,7 +75,7 @@ jobs:
|
||||
|
||||
- name: 检查环境健康状态
|
||||
id: health-check
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'health-status-${{ matrix.environment }}'
|
||||
default-value: 'unknown'
|
||||
@@ -84,7 +84,7 @@ jobs:
|
||||
|
||||
- name: 初始化环境健康状态
|
||||
if: steps.health-check.outputs.state-value == 'unknown'
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'health-status-${{ matrix.environment }}'
|
||||
state-value: 'healthy'
|
||||
@@ -108,7 +108,7 @@ jobs:
|
||||
|
||||
- name: 获取开发环境配置
|
||||
id: dev-config
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'replicas-dev'
|
||||
action: 'get'
|
||||
@@ -116,7 +116,7 @@ jobs:
|
||||
|
||||
- name: 获取预发布环境配置
|
||||
id: staging-config
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'replicas-staging'
|
||||
action: 'get'
|
||||
@@ -124,7 +124,7 @@ jobs:
|
||||
|
||||
- name: 获取生产环境配置
|
||||
id: prod-config
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'replicas-production'
|
||||
action: 'get'
|
||||
@@ -161,7 +161,7 @@ jobs:
|
||||
echo "dev_health=${HEALTH_STATUS}" >> $GITHUB_ENV
|
||||
|
||||
- name: 更新开发环境健康状态
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'health-status-dev'
|
||||
state-value: ${{ env.dev_health }}
|
||||
@@ -177,7 +177,7 @@ jobs:
|
||||
echo "staging_health=${HEALTH_STATUS}" >> $GITHUB_ENV
|
||||
|
||||
- name: 更新预发布环境健康状态
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'health-status-staging'
|
||||
state-value: ${{ env.staging_health }}
|
||||
@@ -193,7 +193,7 @@ jobs:
|
||||
echo "prod_health=${HEALTH_STATUS}" >> $GITHUB_ENV
|
||||
|
||||
- name: 更新生产环境健康状态
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'health-status-production'
|
||||
state-value: ${{ env.prod_health }}
|
||||
@@ -235,14 +235,14 @@ jobs:
|
||||
echo "=== 开发环境状态 ==="
|
||||
|
||||
- name: 读取开发环境配置
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'replicas-dev'
|
||||
action: 'get'
|
||||
cache-prefix: 'env-config'
|
||||
|
||||
- name: 读取开发环境健康状态
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'health-status-dev'
|
||||
action: 'get'
|
||||
@@ -282,7 +282,7 @@ jobs:
|
||||
# 例如,设置空值来清理特定的缓存状态
|
||||
|
||||
- name: 重置所有环境的临时状态
|
||||
uses: .actions/xgj/cache-state@v1
|
||||
uses: actions/xgj/cache-state@v1
|
||||
with:
|
||||
state-key: 'temp-maintenance-mode'
|
||||
state-value: ''
|
||||
|
Reference in New Issue
Block a user