Commit Graph
914 Commits
Author SHA1 Message Date
zqlit 80ea1ff5b3 fix(ci): 删除空壳 deploy-upyun job,UpYun 直传改为如实上报三态
Deploy to Production / pre-check (push) Successful in 2m6s
Deploy to Production / build (push) Successful in 4m18s
Deploy to Production / deploy-edgeone (push) Successful in 7s
Deploy to Production / finalize (push) Successful in 16s
Deploy to Production / notify-failure (push) Skipped
deploy-upyun 是零上传动作的空壳 job,却无条件打印「UpYun 已同步最新内容」,其输出被 Telegram / 飞书 / 邮件通知当成 UpYun 部署成功的依据;真正的上传步骤标了 continue-on-error,失败也不影响 job 颜色。三层叠加,导致 7/25 起国内线路停更两个多月而通知始终显示成功。

改动:删除 deploy-upyun(finalize / notify-failure 的 needs 同步清理);Upload to UpYun 在退出时写 GITHUB_OUTPUT,如实上报 success / failure / skipped 三态与真实耗时(不用 steps.outcome,只依赖最通用的 output 传递);通知与 Step Summary 改为展示三态真实结果,移除「文件已在 Build 阶段同步」这类未经验证的说法。

又拍云直传失败仍不阻断流水线 —— 国内线路由腾讯云广州的 1Panel 计划任务「又拍云同步(国内中转)」每分钟兜底增量推送。
2026-10-01 16:47:05 +08:00
Write Server 95a8455c0e 发布: 删除《GitHub用量又超了》
Deploy to Production / pre-check (push) Successful in 2m18s
Deploy to Production / build (push) Successful in 5m30s
Deploy to Production / deploy-edgeone (push) Successful in 4m1s
Deploy to Production / deploy-upyun (push) Successful in 6s
Deploy to Production / finalize (push) Successful in 37s
Deploy to Production / notify-failure (push) Skipped
2026-10-01 06:46:45 +00:00
Write Server 11dda8e66c 发布: 自建了 Gitea,测试一下部署
Deploy to Production / pre-check (push) Successful in 1m33s
Deploy to Production / build (push) Successful in 9m0s
Deploy to Production / deploy-edgeone (push) Successful in 4m6s
Deploy to Production / deploy-upyun (push) Successful in 8s
Deploy to Production / finalize (push) Successful in 33s
Deploy to Production / notify-failure (push) Skipped
2026-10-01 05:51:21 +00:00
zqlit e1f0b49754 fix(ci): 修复提交信息含 ${{ }} 字样导致 pre-check 崩溃
Deploy to Production / pre-check (push) Successful in 2m35s
Deploy to Production / build (push) Successful in 7m53s
Deploy to Production / deploy-edgeone (push) Successful in 3m52s
Deploy to Production / deploy-upyun (push) Successful in 5s
Deploy to Production / finalize (push) Successful in 30s
Deploy to Production / notify-failure (push) Skipped
根因:pre-check 的 Validate commit 步骤把 commit message 直接插值进 shell 脚本:

    COMMIT_MESSAGE="${{ github.event.head_commit.message }}"

多行提交信息会撑破脚本;若正文里出现 ${{ ... }} 之类字样(例如上一次提交
正文中的 ${{ gitea.* }}),bash 会把它当变量展开并报 "bad substitution",
exit 1 → pre-check failure → build 被 skip。

实证(Gitea task 35 日志):
    /var/run/act/workflow/commit-check: line 20: perf(ci): 兼容 GitHub Actions...
    : bad substitution
    ❌ Failure - Main Validate commit (only for push events)

修复:改用 step 级 env: 传值(COMMIT_AUTHOR / COMMIT_MESSAGE),
commit message 不再进入脚本文本。GitHub Actions 与 Gitea Actions
行为一致,两边都安全,同时消除命令注入面。

本次提交正文刻意保留了 ${{ gitea.* }} 字样,作为该修复的回归验证。
2026-10-01 12:37:22 +08:00
zqlit 92326fff38 perf(ci): 兼容 GitHub Actions 并大幅缩短构建耗时
Deploy to Production / pre-check (push) Failing after 2m54s
Deploy to Production / build (push) Skipped
Deploy to Production / deploy-edgeone (push) Skipped
Deploy to Production / deploy-upyun (push) Skipped
Deploy to Production / finalize (push) Skipped
Deploy to Production / notify-failure (push) Successful in 6s
兼容性(迁移回 GitHub Actions 必需):
- 移除 5 处 ${{ gitea.* }} 专有上下文(Gitea 之外会求值失败),
  改为按 github.server_url 判断的 RUN_URL,GitHub / Gitea 通用
- Telegram / 飞书 / 邮件里的运行详情链接两边都正确

耗时优化:
- build: checkout 加 filter=blob:none(partial clone),
  保留完整提交历史供 Hugo 的 :git lastmod 使用,
  但不拉历史版本的文件内容(多为图片),省约 200MB 传输
- deploy-edgeone: 移除 checkout(原先约 81 秒),内联原 deploy_edgeone.sh
- finalize: 移除 checkout(约 145 秒)与 npm ci(约 66 秒),
  内联零依赖的 refresh_cdn.js(只用 node 内置 crypto 与 fetch)
- finalize: setup-node 不再启用 npm 缓存(本 job 已不安装依赖)

UpYun 相关按用户要求保持原样不动。
2026-10-01 12:22:41 +08:00
zqlit ad118b470d perf(ci): Gitea 环境跳过无效缓存,消除每次约 9 分钟空等
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
根因:/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
zqlit 6838934fa5 fix(ci): 修复定时构建「无新提交则跳过」逻辑失效
Deploy to Production / pre-check (push) Successful in 42s
Deploy to Production / build (push) Canceled after 11m47s
Deploy to Production / deploy-edgeone (push) Canceled after 0s
Deploy to Production / deploy-upyun (push) Canceled after 0s
Deploy to Production / finalize (push) Canceled after 0s
Deploy to Production / notify-failure (push) Canceled after 0s
根因:pre-check job 的 outputs.can_deploy 绑定在 steps.repo-check 上,
而该步骤是无条件写 true;真正写 can_deploy=false 的是 steps.cron-check,
它写进自己步骤的 outputs,从未被 job 级 output 采用。
于是 build 的 if: needs.pre-check.outputs.can_deploy == 'true' 恒为真。

证据(run 8, event=schedule):
- 日志 cron-check 已打印「距离上次提交: 9 小时 / 超过 1 小时没有新提交,跳过定时构建」
- 但随后 build 的 if 表达式求值
  'steps.repo-check.outputs.can_deploy' 结果为 true,build 照常执行

后果:每天北京 09:00 无条件全量构建(build ~17min + finalize ~12.5min),
2 核服务器被白占约 32 分钟/天。线上不受影响(build hash 未变,
COS/EdgeOne/UpYun 上传与部署均正确 skip)。

改动:
- 合并 repo-check 与 cron-check 为单一步骤 decide,统一计算并输出 can_deploy
- pre-check.outputs.can_deploy 改指向 steps.decide.outputs.can_deploy
- 去掉原 cron-check 的 exit 0(避免步骤提前中断导致 output 丢失)
2026-10-01 11:30:15 +08:00
zqlit 83d87ddeaf fix(ci): 加固 UpYun 上传步骤,修复 upx 下载挂死
Deploy to Production / pre-check (push) Successful in 54s
Deploy to Production / build (push) Successful in 18m13s
Deploy to Production / deploy-edgeone (push) Successful in 11s
Deploy to Production / deploy-upyun (push) Successful in 6s
Deploy to Production / finalize (push) Successful in 12m29s
Deploy to Production / notify-failure (push) Skipped
根因:collection.b0.upaiyun.com 实测 2/3 概率整站无响应,
而 curl -sL 无 --max-time,导致步骤永久挂起直到 job 15 分钟超时。

改动:
- upx 主源改用 GitHub Releases(实测 0.5s 稳定),原 CDN 降为兜底
- curl 加 --connect-timeout/--max-time/--retry
- upx login/put 加 timeout 兜底,sync 加 480s 上限
- 删除无效的 Cache upx 步骤(缓存路径 /tmp 随 job 容器销毁,永远命中不了)
- 给 Upload to UpYun 加 timeout-minutes: 10
2026-09-30 23:37:53 +08:00
zqlit 33d54453d7 fix(ci): 用 Python 重写 pre-build 脚本,替换 PowerShell 依赖
Deploy to Production / pre-check (push) Successful in 29s
Deploy to Production / build (push) Failing after 23m24s
Deploy to Production / deploy-edgeone (push) Skipped
Deploy to Production / deploy-upyun (push) Skipped
Deploy to Production / finalize (push) Skipped
Deploy to Production / notify-failure (push) Successful in 4s
Gitea 自建 runner 镜像不含 PowerShell,导致 Run Pre-Build Scripts
以 exitcode 127 失败。改用 Python 3(GitHub/Gitea runner 均预装),
跨平台通用,迁回 GitHub 无需改回。
2026-09-30 22:50:43 +08:00
zqlit f64d8f30f3 chore: 清理误提交的 .claude/worktrees gitlink
Deploy to Production / pre-check (push) Successful in 3m35s
Deploy to Production / build (push) Failing after 10m9s
Deploy to Production / deploy-edgeone (push) Skipped
Deploy to Production / deploy-upyun (push) Skipped
Deploy to Production / finalize (push) Skipped
Deploy to Production / notify-failure (push) Successful in 7s
- 移除 4 个空目录 gitlink(导致 checkout 报 No url found for submodule path)
- .gitignore 忽略 .claude/worktrees/
2026-09-30 20:30:08 +08:00
zqlit 8d9eef0f4f chore: add Gitea Actions support and secrets checklist 2026-09-30 15:20:27 +08:00
Write Server 52aac9f507 发布: GitHub用量又超了 2026-09-08 07:40:10 +00:00
Write Server 651b5e2c45 发布: 流量卡还真得选御三家😂 2026-07-24 02:23:34 +00:00
Write Server 1b96cc4938 发布: 最成功的一次红烧鱼 2026-07-19 03:52:07 +00:00
Write Server 5cf989a5f0 发布: 国企面试,别太当回事儿 2026-07-08 03:20:35 +00:00
GitHub Actions 017b6599bd chore: auto-optimize images [skip ci] 2026-07-04 10:09:26 +08:00
Write Server a7e8b80511 发布: 入手了智能手表 OPPO watch x3 2026-07-04 02:07:49 +00:00
Write Server 084719491c 发布: GitHub Action 缓存额度超了,发不出文章😅 2026-06-30 08:40:12 +00:00
Write Server d527672d1a 发布: 复刻了某红书的西红柿鸡蛋炒牛肉 2026-06-30 08:27:51 +00:00
Write Server 4de59bd22b 发布: GitHub Action 缓存额度超了,发不出文章😅 2026-06-30 04:47:39 +00:00
Vaica e03d5cb78b Merge branch 'main' of https://github.com/zqlit/blog 2026-06-30 12:47:29 +08:00
Vaica 673af08c33 Update artalk.html 2026-06-30 12:47:27 +08:00
Write Server 98195aeb39 发布: GitHub Action 缓存额度超了,发不出文章😅 2026-06-30 04:21:19 +00:00
Vaica 08dc480aab Merge branch 'main' of https://github.com/zqlit/blog 2026-06-30 11:52:46 +08:00
Vaica 94f6f710fc Update deploy.yml 2026-06-30 11:52:36 +08:00
Write Server 8942769fc6 发布: GitHub Action 缓存额度超了,发不出文章😅 2026-06-30 03:49:12 +00:00
Vaica 8c625f1624 Update deploy.yml 2026-06-30 11:41:34 +08:00
Vaica 38355ce6ac Merge branch 'main' of https://github.com/zqlit/blog 2026-06-30 11:38:06 +08:00
Vaica f019c3099a Update deploy.yml 2026-06-30 11:38:03 +08:00
Write Server 78e8e3c737 发布: GitHub Action 缓存额度超了,发不出文章😅 2026-06-30 03:21:38 +00:00
Write Server f7e8d9ac1f 发布: GitHub Action 缓存额度超了,发不出文章😅 2026-06-30 03:12:01 +00:00
Vaica 2f735d4628 Update deploy.yml 2026-06-30 10:59:28 +08:00
Vaica a688134508 Update deploy.yml 2026-06-30 10:45:32 +08:00
Write Server 1bf40d8810 发布: GitHub Action 缓存额度超了,发不出文章😅 2026-06-30 02:37:45 +00:00
Vaica 98b9584b97 Update deploy.yml 2026-06-30 10:31:50 +08:00
Vaica 7b126b58e3 Update deploy.yml 2026-06-30 10:24:51 +08:00
Vaica 8db5e417a8 Update deploy.yml 2026-06-30 10:17:21 +08:00
Vaica 5793280712 Update deploy.yml 2026-06-29 23:08:00 +08:00
Vaica 145fb5f454 Merge branch 'main' of https://github.com/zqlit/blog 2026-06-29 22:53:30 +08:00
Vaica 9dc501f033 Update deploy.yml 2026-06-29 22:53:20 +08:00
Write Server 5dbadc51ea 发布: GitHub Action 缓存额度超了,发不出文章😅 2026-06-29 14:45:57 +00:00
Vaica 28ecb667a6 Update deploy.yml 2026-06-29 22:43:47 +08:00
Vaica ffc69d2d0c Update deploy.yml 2026-06-29 22:33:32 +08:00
Vaica 58ea3cb545 Update deploy.yml 2026-06-29 22:26:59 +08:00
Vaica 5371d5d9dc Update deploy.yml 2026-06-29 22:09:22 +08:00
Vaica c1d1f64bcc Update deploy.yml 2026-06-29 21:58:53 +08:00
Vaica 81310a7995 Update deploy.yml 2026-06-29 19:21:56 +08:00
Vaica 084b1cc6aa Update deploy.yml 2026-06-29 19:16:40 +08:00
Vaica 6c560d104a Update deploy.yml 2026-06-29 19:14:07 +08:00
Vaica 23392328c3 Update deploy.yml 2026-06-29 19:08:26 +08:00