Skip to content

ci: fix Docker GHA caching and add merge_group trigger#1101

Merged
BenjaminMichaelis merged 1 commit into
mainfrom
agents/docker-caching-github-actions
May 14, 2026
Merged

ci: fix Docker GHA caching and add merge_group trigger#1101
BenjaminMichaelis merged 1 commit into
mainfrom
agents/docker-caching-github-actions

Conversation

@BenjaminMichaelis
Copy link
Copy Markdown
Member

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.yml

Add merge_group trigger

Docker 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: false

The Docker step was exporting the image to a .tar file (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 with push: false skips the extraction while still writing all layers to the GHA cache.

Build-Test-And-Deploy.yml

Remove dead "Docker build (no push)" step

The step had this condition:

if: github.event_name == 'pull_request' || github.event_name == 'merge_group'

But this workflow only triggers on push: branches: [main] and workflow_dispatch — so that condition can never be true. The step was dead code. PR and merge_group Docker validation is now correctly owned by PR-Build-And-Test.yml (via the merge_group trigger added above).

Before / After

Workflow Before After
PR Docker build Exports unused tar, no merge queue coverage push: false, runs on merge queue too
Main Docker build Has unreachable dead step Dead step removed; caching unchanged

- 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>
Copilot AI review requested due to automatic review settings May 14, 2026 00:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_group to 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.

@BenjaminMichaelis BenjaminMichaelis merged commit d074fee into main May 14, 2026
11 checks passed
@BenjaminMichaelis BenjaminMichaelis deleted the agents/docker-caching-github-actions branch May 14, 2026 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants