diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index aff03321..85f91132 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -148,12 +148,17 @@ jobs: uses: actions/setup-node@v4 with: node-version: '22' - cache: 'npm' + # Gitea 的 runner 缓存服务与 job 容器跨 bridge 网络不可达, + # 每次 restore/save 各死等约 4 分半后 ETIMEDOUT(纯浪费约 9 分钟), + # 因此仅在 GitHub 上启用缓存;Gitea 上传空值让 setup-node 跳过缓存。 + cache: ${{ github.server_url == 'https://github.com' && 'npm' || '' }} - name: Install Node.js dependencies - run: npm ci + run: npm ci --no-audit --no-fund - name: Cache Hugo resources + # 同 Setup Node:Gitea 环境缓存服务不可达,跳过以免每次白等 + if: github.server_url == 'https://github.com' uses: actions/cache@v4 id: hugo-cache with: @@ -362,7 +367,11 @@ jobs: echo "- **文件总数**: ${{ steps.stats.outputs.file_count }}" >> $GITHUB_STEP_SUMMARY echo "- **总大小**: ${{ steps.stats.outputs.total_size }}" >> $GITHUB_STEP_SUMMARY echo "- **构建哈希**: ${{ steps.hash.outputs.build_hash }}" >> $GITHUB_STEP_SUMMARY - echo "- **Hugo 缓存**: ${{ steps.hugo-cache.outputs.cache-hit == 'true' && '✅ 命中' || '🔄 未命中' }}" >> $GITHUB_STEP_SUMMARY + if [ "${{ github.server_url }}" = "https://github.com" ]; then + echo "- **Hugo 缓存**: ${{ steps.hugo-cache.outputs.cache-hit == 'true' && '✅ 命中' || '🔄 未命中' }}" >> $GITHUB_STEP_SUMMARY + else + echo "- **Hugo 缓存**: ⏭️ 已跳过 (Gitea 缓存服务跨网段不可达)" >> $GITHUB_STEP_SUMMARY + fi # ============================================================ # Job 3: Deploy to EdgeOne Pages (并行) @@ -564,10 +573,13 @@ jobs: uses: actions/setup-node@v4 with: node-version: '22' - cache: 'npm' + # Gitea 的 runner 缓存服务与 job 容器跨 bridge 网络不可达, + # 每次 restore/save 各死等约 4 分半后 ETIMEDOUT(纯浪费约 9 分钟), + # 因此仅在 GitHub 上启用缓存;Gitea 上传空值让 setup-node 跳过缓存。 + cache: ${{ github.server_url == 'https://github.com' && 'npm' || '' }} - name: Install Node.js dependencies - run: npm ci + run: npm ci --no-audit --no-fund - name: Determine deployment status id: deploy-status