Skip to content

ci(docker): skip PR triggers β€” build only on push to main + release#218

Merged
parth0025 merged 1 commit into
stagingfrom
ci/docker-skip-pr-trigger
Jun 9, 2026
Merged

ci(docker): skip PR triggers β€” build only on push to main + release#218
parth0025 merged 1 commit into
stagingfrom
ci/docker-skip-pr-trigger

Conversation

@parth0025

Copy link
Copy Markdown
Collaborator

Summary

Stop running the Docker multi-arch build on PRs. From now on, it only runs when something actually needs to be published:

  • release: published β†’ publishes versioned tags + latest (release-please-driven)
  • push: branches: [main] β†’ publishes edge + main-<sha>
  • workflow_dispatch β†’ manual run from the Actions UI

The pull_request trigger is removed.

Why

Multi-arch docker builds (amd64 + arm64 via QEMU emulation) are slow:

Scenario Build time
First-time / cold cache 12–18 min
Warm GHA cache, only source changed 3–6 min
Warm GHA cache, Dockerfile changed 8–12 min

Even the cached case is longer than every other CI check in this repo. On PR #216 today, the build was visibly blocking review for ~15 minutes per attempt. Since PR builds are push: false anyway (verification-only, nothing pushed to a registry), the value-to-cost ratio is poor.

Trade-off

Before After
Docker breakage caught at PR-review time Docker breakage caught at post-merge time on main
15 min added to every Docker-touching PR PRs are fast again
push: false build artifact discarded (same β€” PR builds were never published anyway)

If a Docker-breaking change does land on main:

  • release.yml will fail when release-please tries to build for the release tag β€” surfaced before users see anything
  • Revert via "Revert" button on the offending PR β†’ 30 seconds

What still triggers a build

Event Triggers?
PR opened against main (touches Docker files) ❌ No (changed)
PR opened against main (no Docker changes) ❌ No (was already no)
PR opened against staging ❌ No (was already no β€” we removed staging earlier)
Push to main (e.g., PR merged) βœ… Yes β€” builds + pushes edge + main-<sha>
Push to staging ❌ No (was already no)
Release tag published (release-please) βœ… Yes β€” builds + pushes vX.Y.Z, latest, X.Y, X
Manual trigger from Actions UI βœ… Yes

Files changed (1)

File Change
.github/workflows/docker.yml Remove pull_request trigger + its paths filter; add inline comments documenting each remaining trigger

Diff: +5 / -10 lines.

Test plan

  • After merge, open any PR touching Dockerfile β†’ Docker workflow should NOT run on it
  • After merge, push a commit to main (or merge a PR to main) β†’ Docker workflow SHOULD run and push edge + main-<sha> to GHCR
  • Trigger workflow_dispatch manually β†’ should run on demand
  • When release-please publishes the next release, the release: published event should fire the workflow + push versioned tags

Compatibility

βœ… No conflict with any open PR (touches only .github/workflows/docker.yml)
βœ… Doesn't touch the Dockerfile, docker-compose.yml, or any build artifact
βœ… Doesn't change what gets published β€” only when it gets built

πŸ€– Generated with Claude Code

Docker workflow no longer runs on pull_request events. Triggers
are now scoped to:
  - release: published      (release-please tags)
  - push to main            (after a PR merges)
  - workflow_dispatch       (manual run from Actions UI)

Rationale: multi-arch docker builds (amd64 + arm64 via QEMU
emulation) take 12-18 minutes on cold cache, 3-6 minutes on
warm cache. Running them on every PR (even with the paths-filter
scoping to docker-related files) blocks PR review feedback and
slows the iteration loop.

Trade-off accepted:
  - Docker breakage is now caught one step later: after a PR
    merges to main, not during PR review.
  - Easy to revert with a follow-up PR if a breaking change
    lands on main.
  - release.yml will fail loudly if the post-merge image build
    is broken, so we still get a hard signal before tagging
    a release.

Docker files (Dockerfile, .dockerignore, docker-compose.yml,
docker.yml) change rarely β€” most PRs are unaffected by this
change.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

βš™οΈ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5e1d168b-e218-4c07-a972-559a3962919f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • πŸ” Trigger review
✨ Finishing Touches
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/docker-skip-pr-trigger

Comment @coderabbitai help to get the list of available commands and usage tips.

@parth0025 parth0025 merged commit 6d3f34d into staging Jun 9, 2026
4 checks passed
@parth0025 parth0025 deleted the ci/docker-skip-pr-trigger branch June 9, 2026 14:16
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.

1 participant