diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index 2c71d363..f1fd8c37 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -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: