ci(deploy): 工作流从 4 个 job 精简为 2 个,并启用 BuildKit registry 构建缓存
- 删掉 preflight(npm ci + nuxt build)与 meta-warmup:Dockerfile 自己在容器内 跑 npm ci + node scripts/memory-build.js,这两个 job 的产物从来没被 docker build 用到,纯白烧 3-6 分钟,meta-warmup 还在 build-image 之前抢同一个 runner 的内存。 - 删掉每个 job 各自跑的 apt 换源 / 清华镜像 / git URL 重写:对镜像构建没有任何影响。 - buildx 从「装不上就硬失败/一大段兜底脚本」简化为「装得上就用(带 registry 缓存), 装不上就退普通 docker build」,部署永不因 buildx 缺席而失败。 - 新增 BuildKit registry 缓存(--cache-from/--cache-to type=registry,tag :buildcache): 依赖安装层跨 run 复用,第二次之后的部署会快很多。 - 镜像标签改在 build-image 内计算(原先依赖 meta-warmup 的 outputs)。 - 新增 .gitattributes 强制 yml/sh 用 LF(core.autocrlf=true 会把 heredoc 写坏)。
This commit is contained in:
@@ -0,0 +1,9 @@
|
|||||||
|
# 强制 shell 脚本与工作流用 LF:runner 是 Linux,CRLF 会让 `run: |` 里的 heredoc / 多行脚本出问题
|
||||||
|
*.sh text eol=lf
|
||||||
|
*.yml text eol=lf
|
||||||
|
*.yaml text eol=lf
|
||||||
|
*.mjs text eol=lf
|
||||||
|
*.js text eol=lf
|
||||||
|
*.ts text eol=lf
|
||||||
|
*.json text eol=lf
|
||||||
|
Dockerfile text eol=lf
|
||||||
+183
-904
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user