fix(ci): 清理 _diag/pages 避免 log 檔衝突

Runner 並行執行時 _diag/pages/*.log 會產生衝突
新增清理該目錄的步驟

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
OG T
2026-03-26 01:07:07 +08:00
parent 8ee2437a7f
commit ac294c1e3c

View File

@@ -55,10 +55,12 @@ jobs:
runs-on: [self-hosted, harbor, k8s]
timeout-minutes: 1
steps:
# 2026-03-26: 清理暫存目錄,避免 set_output file conflict
# 2026-03-26: 清理暫存目錄,避免 file conflict (pages + temp)
- name: "Clean Runner temp"
run: |
RUNNER_ROOT=$(dirname "$(dirname "$RUNNER_TEMP")")
rm -rf "$RUNNER_TEMP"/* 2>/dev/null || true
rm -rf "$RUNNER_ROOT/_diag/pages"/* 2>/dev/null || true
rm -rf .claude/worktrees 2>/dev/null || true
- name: "Check Required Secrets"
@@ -109,9 +111,11 @@ jobs:
api: ${{ inputs.force_deploy == true && 'true' || steps.filter.outputs.api }}
web: ${{ inputs.force_deploy == true && 'true' || steps.filter.outputs.web }}
steps:
# 2026-03-26: 清理暫存目錄
# 2026-03-26: 清理暫存目錄 (temp + pages)
- name: "Clean Runner temp"
run: rm -rf "$RUNNER_TEMP"/* .claude/worktrees 2>/dev/null || true
run: |
RUNNER_ROOT=$(dirname "$(dirname "$RUNNER_TEMP")")
rm -rf "$RUNNER_TEMP"/* "$RUNNER_ROOT/_diag/pages"/* .claude/worktrees 2>/dev/null || true
- uses: actions/checkout@v4
with:
@@ -145,9 +149,11 @@ jobs:
outputs:
image_tag: ${{ steps.tag.outputs.tag }}
steps:
# 2026-03-26: 清理暫存目錄
# 2026-03-26: 清理暫存目錄 (temp + pages)
- name: "Clean Runner temp"
run: rm -rf "$RUNNER_TEMP"/* .claude/worktrees 2>/dev/null || true
run: |
RUNNER_ROOT=$(dirname "$(dirname "$RUNNER_TEMP")")
rm -rf "$RUNNER_TEMP"/* "$RUNNER_ROOT/_diag/pages"/* .claude/worktrees 2>/dev/null || true
- uses: actions/checkout@v4
@@ -181,9 +187,11 @@ jobs:
outputs:
image_tag: ${{ steps.tag.outputs.tag }}
steps:
# 2026-03-26: 清理暫存目錄
# 2026-03-26: 清理暫存目錄 (temp + pages)
- name: "Clean Runner temp"
run: rm -rf "$RUNNER_TEMP"/* .claude/worktrees 2>/dev/null || true
run: |
RUNNER_ROOT=$(dirname "$(dirname "$RUNNER_TEMP")")
rm -rf "$RUNNER_TEMP"/* "$RUNNER_ROOT/_diag/pages"/* .claude/worktrees 2>/dev/null || true
- uses: actions/checkout@v4
@@ -224,9 +232,11 @@ jobs:
if: always() && (needs.build-api.result == 'success' || needs.build-api.result == 'skipped') && (needs.build-web.result == 'success' || needs.build-web.result == 'skipped')
environment: production
steps:
# 2026-03-26: 清理暫存目錄
# 2026-03-26: 清理暫存目錄 (temp + pages)
- name: "Clean Runner temp"
run: rm -rf "$RUNNER_TEMP"/* .claude/worktrees 2>/dev/null || true
run: |
RUNNER_ROOT=$(dirname "$(dirname "$RUNNER_TEMP")")
rm -rf "$RUNNER_TEMP"/* "$RUNNER_ROOT/_diag/pages"/* .claude/worktrees 2>/dev/null || true
- uses: actions/checkout@v4
with: