fix(ci): switch deploy images to cn registry

This commit is contained in:
chengkml
2026-05-16 14:23:23 +08:00
parent b649fac7b9
commit 90ed11c4da
4 changed files with 47 additions and 14 deletions
+25
View File
@@ -0,0 +1,25 @@
## Work Log - 发布链路切换国内镜像仓库(2026-05-16)
- 背景:
- 当前 `dev` 分支 GitHub Actions 发布阶段在远端执行 `docker login ghcr.io` / `docker compose pull` 时失败。
- 典型报错为:`Error response from daemon: Get "https://ghcr.io/v2/": EOF`
- 参考仓库 `multica-ck` 已采用“可配置国内镜像仓库 + 账号密码登录”的工作流模式。
- 本次改动:
- `/.github/workflows/main.yml`
- 将工作流默认镜像仓库从固定 `ghcr.io` 改为 `REGISTRY` / `REGISTRY_NAMESPACE` 可配置模式。
- 默认值对齐 `multica-ck``crpi-u265r07n4blchcqo.cn-shanghai.personal.cr.aliyuncs.com/ck-registry`
- 构建推送阶段改为使用 `REGISTRY_USERNAME` / `REGISTRY_PASSWORD` 登录镜像仓库。
- 部署阶段新增镜像仓库凭据校验,并将远端 `docker login ghcr.io` 改为登录 `${REGISTRY}`
- API / Web 镜像构建补充 `pull: true`,降低 runner 侧基底镜像陈旧风险。
- `/deploy/pro-deploy/.env`
- 将默认 `API_IMAGE` / `WEB_IMAGE` 从 GHCR 地址替换为阿里云个人版容器仓库地址,保证非 CI 手工部署默认也不再回落到 GHCR。
- 验证:
- `git diff --check -- .github/workflows/main.yml deploy/pro-deploy/.env` 通过,无空白/格式错误。
- 仓库内已清除工作流与生产部署默认镜像中的 `ghcr.io` 活动引用。
- 本次未直接触发 GitHub Actions 真实发布,远端连通性需在下一次 CI 执行中验证。
- 风险与关注点:
- GitHub 仓库需预先配置 `REGISTRY_USERNAME` / `REGISTRY_PASSWORD` Secrets,否则构建登录阶段会失败。
- 若未来镜像仓库或命名空间变化,只需更新仓库 Variables `REGISTRY` / `REGISTRY_NAMESPACE`,无需再改工作流逻辑。