fix(ci): resolve Docker build race condition #46
Reference in New Issue
Block a user
Delete Branch "fix/ci-race-condition"
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
Fixes a race condition where
release-unified.yamlandbuild-and-push.yamlwould both build and push the Docker image during releases, with the losing build potentially overwriting:latestwith a stale image (missing tools likecrushandopencode).Root Cause
When
release-unified.yamlruns a release:main→ triggersbuild-and-push.yamlv*tag → triggersbuild-and-push.yamlagain:latestThis creates up to 3 concurrent Docker builds racing to push
:latest. Thebuild-and-push.yamlbuilds use GHA layer cache which may serve stale layers from before new Dockerfile changes, overwriting the correct:latestimage.Changes
tags: ['v*']trigger —release-unified.yamlalready handles the full release flow (Docker build + Helm chart + GitHub release)releasejob — Helm packaging and GitHub release creation are handled byrelease-unified.yamlgithub-actions[bot]— prevents the "chore: release version" commit from triggering a racing buildAfter this fix
build-and-push.yaml:latest,:main,:sha-xxxbuild-and-push.yamlv*pushbuild-and-push.yamlbuild-and-push.yamlrelease-unified.yamlTest plan
release-unified.yamland verify only one Docker build runs:latestimage containscrushandopencodeafter release🤖 Generated with Claude Code