Skip to content

Adopt branch-conditional Docker platforms (multi-arch main, amd64 elsewhere) - #248

Merged
ptr727 merged 2 commits into
developfrom
feature/docker-platform-split
Jul 6, 2026
Merged

Adopt branch-conditional Docker platforms (multi-arch main, amd64 elsewhere)#248
ptr727 merged 2 commits into
developfrom
feature/docker-platform-split

Conversation

@ptr727

@ptr727 ptr727 commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Generalizes the platform pattern proven on ESPHome-NonRoot #125 into the catalog build-docker-task snippet + the WORKFLOW.md contract.

  • One job-level env.PLATFORMS computes the platform list; both build steps reference it; QEMU gates on contains(env.PLATFORMS, 'arm64').
  • Default branch: multi-arch (amd64+arm64); any other branch: amd64 only - arm64 emulation (the bulk of Docker CI minutes) is reserved for the released image.
  • Compatible with the current publisher; the symmetric-release publisher rewrite follows as a separate PR.

WORKFLOW.md Docker guarantees updated to describe the split.

…branch, amd64 elsewhere

Generalize the pattern proven on ESPHome-NonRoot (#125): compute the platform list once as job-level env.PLATFORMS in build-docker-task, reference it from both build steps, and gate QEMU on contains(env.PLATFORMS, 'arm64'). The default branch builds multi-arch (amd64+arm64); any other branch builds amd64 only, reserving arm64 emulation (~the bulk of Docker CI minutes) for the released image. Update the WORKFLOW.md Docker guarantees to match.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 6, 2026 16:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the template's Docker build contract and reusable snippet to reduce CI cost by limiting arm64 emulation to default-branch publish runs, while keeping non-default branch builds amd64-only.

Changes:

  • Document Docker's branch-conditional platform behavior in WORKFLOW.md (multi-arch on default branch, amd64-only elsewhere).
  • Refactor the Docker build task snippet to compute a single job-level env.PLATFORMS, reuse it for Buildx/build-push, and gate QEMU setup based on whether arm64 is included.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
WORKFLOW.md Updates the documented Docker behavioral contract to describe default-branch multi-arch vs. amd64-only elsewhere.
catalog/snippets/workflows/build-docker-task.yml Implements a single PLATFORMS selector, uses it consistently for Buildx/build, and conditionally installs QEMU only when arm64 is included.

Comment thread catalog/snippets/workflows/build-docker-task.yml Outdated
Comment thread catalog/snippets/workflows/build-docker-task.yml Outdated
Reserve arm64 emulation for the released image by keying env.PLATFORMS off inputs.push (main => multi-arch only when actually publishing). Register QEMU with the proven os/arch form linux/arm64 (the form the original config used successfully). Addresses Copilot review.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@ptr727
ptr727 merged commit 5079452 into develop Jul 6, 2026
7 checks passed
@ptr727
ptr727 deleted the feature/docker-platform-split branch July 6, 2026 16:20
ptr727 added a commit that referenced this pull request Jul 7, 2026
Two-phase promotion of the accumulated governance work on `develop` to
`main`. Carries #244-#251:

- #244 Foundational Principles (the model's governing *why*)
- #245 Replace the mypy ban with a strong-typing policy
- #246 aiopurpleair + homeassistant-purpleair audit reports
- #247 Catalog the 14 backlog repos; add the `eda` type and
`releaseTrigger: none`
- #248 Branch-conditional Docker platforms (multi-arch main, amd64
elsewhere)
- #249 Retire the both-branch matrix for symmetric single-branch
self-release
- #250 Declare workflow YAML as LF and validate line endings in CI
- #251 Extend line-ending governance to pattern files and catalog
snippets

All commits were reviewed and CI-green on their individual develop PRs.
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