mirror of
https://git.bjxgj.com/xgj/xgj-actions.git
synced 2025-10-14 16:53:37 +08:00
fix: 更新 cache-state 示例文件,修正 GitHub Action 使用路径,从 .actions/xgj/cache-state@v1 修改为 actions/xgj/cache-state@v1,以确保正确引用和执行缓存状态管理功能。
This commit is contained in:
@@ -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