feat(ci): build-once-promote pattern to eliminate double Docker build#7770
Merged
feat(ci): build-once-promote pattern to eliminate double Docker build#7770
Conversation
The CI pipeline was building the Docker image twice — once for e2e testing (~43 min) and again for publishing (~40 min) on separate runners with no shared cache. Now the test job pushes the built image to GHCR as a ci-<sha> tag after e2e passes. The publish job pulls and retags it instead of rebuilding. Falls back to full build if no CI image found. Also skip Playwright browser download in Dockerfile (unused, ~600MB).
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ghcr.io/<image>:ci-<sha>after e2e passes, and the publish job pulls + retags instead of rebuilding.PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1to Dockerfile astro-builder stage. Playwright was downloading ~600MB of browsers that are never used inside the build, and frequently timing out.image), the publish job falls back to full build.Changes
docker-test-app.ymlimageinput,packages: write, push CI image after e2eutils-publish-docker-image.ymlpromote.foundci-main.ymlimageto e2e matrix, pass to test workflow, elevate permissionsapps/kbve/axum-kbve/DockerfilePLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1Expected impact
Test plan
ghcr.io/kbve/kbve:ci-<sha>after e2e passes