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