perf(cd): 恢復 CACHE_BUST 方案,還原 5m50s Web build
All checks were successful
CD Pipeline / build-and-deploy (push) Successful in 16m2s
All checks were successful
CD Pipeline / build-and-deploy (push) Successful in 16m2s
實測結果: - --no-cache: 10m50s(最慢) - buildx registry cache: 不相容(docker driver 限制) - CACHE_BUST=git_sha + inline cache: 5m50s(最快且安全) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -193,15 +193,21 @@ jobs:
|
||||
|
||||
# 2026-03-31 ogt: 移除中間通知,減少訊息雜訊
|
||||
|
||||
# ── Web 鏡像建置(強制重建,禁止快取)──────────────────────────────
|
||||
# ── Web 鏡像建置(精準快取失效)──────────────────────────────
|
||||
# 2026-03-30 ogt: NEXT_PUBLIC_* 必須用公網域名 (build-time 寫死)
|
||||
# 2026-04-12 ogt: 還原 --no-cache(ADR-045 / feedback_docker_buildkit_cache_poisoning)
|
||||
# buildx registry cache-to + --output type=docker 不相容(docker driver 限制)
|
||||
# Web bundle 禁用快取:快取毒化會讓舊 bundle 進生產,風險遠高於速度損失
|
||||
# 2026-04-01 Claude Code: CACHE_BUST=git_sha 取代 --no-cache
|
||||
# - deps 層 (pnpm install) 仍可 cache → 節省 ~2-3 min
|
||||
# - COPY . . 以下由 CACHE_BUST 強制失效 → 業務邏輯/CSRF 等變更正確進入 bundle
|
||||
# 2026-04-12 ogt: 實測 --no-cache=10m50s;CACHE_BUST=5m50s,恢復此方案
|
||||
- name: Build and Push Web
|
||||
env:
|
||||
DOCKER_BUILDKIT: "1"
|
||||
run: |
|
||||
docker build --no-cache -f apps/web/Dockerfile \
|
||||
docker build -f apps/web/Dockerfile \
|
||||
--build-arg NEXT_PUBLIC_API_URL=https://awoooi.wooo.work \
|
||||
--build-arg CACHE_BUST=${{ github.sha }} \
|
||||
--build-arg BUILDKIT_INLINE_CACHE=1 \
|
||||
--cache-from ${{ env.HARBOR }}/awoooi/web:latest \
|
||||
-t ${{ env.HARBOR }}/awoooi/web:${{ github.sha }} \
|
||||
-t ${{ env.HARBOR }}/awoooi/web:latest \
|
||||
.
|
||||
|
||||
Reference in New Issue
Block a user