Files
blog/.github
zqlit ad118b470d
Deploy to Production / pre-check (push) Successful in 54s
Deploy to Production / build (push) Successful in 9m8s
Deploy to Production / deploy-edgeone (push) Successful in 5m29s
Deploy to Production / deploy-upyun (push) Successful in 6s
Deploy to Production / finalize (push) Successful in 4m17s
Deploy to Production / notify-failure (push) Skipped
perf(ci): Gitea 环境跳过无效缓存,消除每次约 9 分钟空等
根因:/opt/gitea/runner/config.yaml 中 container.network=gitea_default
(job 容器落在 172.20.x),但 runner 容器自身只挂在 bridge 网络
(172.17.0.2),其提供的缓存服务 172.17.0.2:44869 跨 bridge 网段不可达。

实测证据:
- runner 容器内 wget http://127.0.0.1:44869/ -> HTTP 404(服务活着)
- gitea 容器 wget http://172.17.0.2:44869/  -> download timed out
- 构建日志:Setup Node restore 死等 278s(01:07:17 -> 01:11:55 ETIMEDOUT)
            Post Setup Node save 死等 288s(01:14:54 -> 01:19:42 ETIMEDOUT)
            Cache Hugo resources restore 亦超时
合计每次构建约 10 分钟纯浪费,且缓存从未真正命中或保存成功过。

改动:
- Setup Node 的 cache 改为按 github.server_url 条件启用;Gitea 上
  表达式求值为空串,setup-node 自动跳过缓存
- Cache Hugo resources 步骤加 if 条件,Gitea 上不执行(避免 restore+save 双超时)
- npm ci 增加 --no-audit --no-fund
- step summary 在 Gitea 上如实显示"已跳过",不再误报"未命中"

无副作用:npm ci 实测 68s 本就是在无缓存状态下跑的(restore 从未成功),
去掉缓存不会使其变慢;GitHub 侧行为完全不变。
2026-10-01 11:42:43 +08:00
..