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:
@@ -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'
|
||||
|
Reference in New Issue
Block a user