ci: fix Docker GHA caching and add merge_group trigger#1101
Merged
Conversation
- PR-Build-And-Test.yml: Add merge_group trigger so Docker validation and tests run in the GitHub merge queue - PR-Build-And-Test.yml: Replace outputs: type=docker,dest=*.tar with push: false — tar was never uploaded as artifact; this skips the slow layer extraction while still populating the GHA cache - Build-Test-And-Deploy.yml: Remove dead "Docker build (no push)" step whose condition (pull_request || merge_group) could never be true since the workflow only triggers on push to main and workflow_dispatch; PR/merge_group validation is now handled by PR-Build-And-Test.yml Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves CI Docker validation by making PR builds compatible with merge queue checks and avoiding unnecessary Docker image tar export in PR validation.
Changes:
- Adds
merge_groupto the PR build/test workflow triggers. - Changes PR Docker validation from unused tar output to
push: false. - Removes an unreachable Docker validation step from the deployment workflow.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
.github/workflows/PR-Build-And-Test.yml |
Adds merge queue coverage and simplifies Docker validation output behavior. |
.github/workflows/Build-Test-And-Deploy.yml |
Removes dead PR/merge-group Docker build logic from a workflow that only runs on push/manual dispatch. |
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
Docker GHA caching (
type=gha) was already in both CI workflows, but three issues made it less effective than it should be.Changes
PR-Build-And-Test.ymlAdd
merge_grouptriggerDocker validation and tests were not running in the GitHub merge queue, meaning a merge could pass without a final Docker build check. Adding
merge_group:ensures the same validation that runs on PRs also runs before merge.Replace tar export with
push: falseThe Docker step was exporting the image to a
.tarfile (outputs: type=docker,dest=...) but that file was never uploaded as an artifact and never used by any downstream job. Exporting to a tar forces BuildKit to fully extract all image layers to disk — adding unnecessary time and disk I/O. Replacing it withpush: falseskips the extraction while still writing all layers to the GHA cache.Build-Test-And-Deploy.ymlRemove dead "Docker build (no push)" step
The step had this condition:
But this workflow only triggers on
push: branches: [main]andworkflow_dispatch— so that condition can never be true. The step was dead code. PR and merge_group Docker validation is now correctly owned byPR-Build-And-Test.yml(via themerge_grouptrigger added above).Before / After
push: false, runs on merge queue too