Optimize CI build pipeline (~15 min → ~3-5 min) #59
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "ci/build-optimization"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
development-dependencies-envnow copies onlypackage.json/package-lock.jsonbeforenpm ci(wasCOPY . /app), so the npm install layer is cached on every code-only commit instead of rebuilt from scratchplatforms: linux/amd64added tobuild-push-action, cuttingsetup-buildx-actionfrom ~5 min to ~30 secactions/cache@v3blocks (copy-pasted 3×) replaced withactions/setup-node@v4+cache: 'npm', which handles path/key/restore automatically and pins Node 20 explicitly.npmrc: Switched fromCOPY .npmrcto--mount=type=secret,id=npmrcin bothnpm cistages — the file is available during install but never written into a Docker layer, so it cannot leak through the registry build cache regardless of future contentsExpected timing
Test plan
setup-buildx-actionlogs ~30s (no QEMU), Docker build showsCACHEDfor npm install layers, build+push completes in ~1-2 mindocker compose pullshould show most layers asAlready existspackage.json— confirm npm layer correctly re-runs (not cached)🤖 Generated with Claude Code