Skip to content

ci: native arm64 runners + DRY docker release workflows via reusable workflow#946

Open
vanducng wants to merge 7 commits intodevfrom
ci/docker-multiarch-dry
Open

ci: native arm64 runners + DRY docker release workflows via reusable workflow#946
vanducng wants to merge 7 commits intodevfrom
ci/docker-multiarch-dry

Conversation

@vanducng
Copy link
Copy Markdown
Contributor

@vanducng vanducng commented Apr 17, 2026

Summary

Supersedes #940. Combines:

  1. Native arm64 runners — drops QEMU emulation (~4x faster arm64 builds) by using ubuntu-24.04-arm runners. Stage 1 builds per-arch, Stage 2 merges into multi-arch manifest.
  2. DRY refactor — extracts shared docker build/merge pattern into a composite action + reusable workflow, eliminating ~450 LOC of YAML duplication.

New files

  • .github/actions/docker-registry-login/action.yaml — composite action for GHCR + Docker Hub login (was repeated 5x inline)
  • .github/workflows/docker-multiarch.yaml — reusable workflow encapsulating per-arch build + manifest merge pipeline

Also

  • Pins ubuntu-24.04 explicitly across all workflows (parity with ubuntu-24.04-arm, avoids silent OS drift)
  • Uses placeholder tokens ({{name}}, {{suffix}}, {{is_latest}}, {{is_variant}}) for matrix values in caller tag-rules — GHA evaluates caller with: expressions eagerly, so matrix context isn't available at caller scope; reusable workflow resolves placeholders at merge-job time

Out of scope

Action version bumps (Node 20 -> 24 deprecation: checkout@v4->v5, setup-go@v5->v6, build-push@v6->v7, etc.) are intentionally deferred to a follow-up PR to keep this diff reviewable.

LOC impact

File Before After Delta
release.yaml 441 215 -226
release-beta.yaml 224 106 -118
NEW docker-multiarch.yaml 0 ~200 +200
NEW docker-registry-login/action.yaml 0 23 +23
Net caller LOC 665 ~544 -121

Validation

Validated on fork vanducng/goclaw (DOCKERHUB_IMAGE patched to dataplanelabs/goclaw) prior to this PR:

Manifest inspection confirms 2-platform (linux/amd64 + linux/arm64) images published to both GHCR + DockerHub for all tags.

  • Before
CleanShot 2026-04-16 at 20 38 25@2x
  • After
CleanShot 2026-04-17 at 09 20 59@2x

Rollback

gh pr revert restores pre-PR state. Low risk — fork validation de-risked this before landing.

Closes

Closes #940

Split each cross-arch docker build into per-arch build jobs on native
ubuntu-24.04-arm/ubuntu-latest runners, then fuse per-arch digests into
a multi-arch manifest in a downstream merge job. Eliminates QEMU
emulation which stalled the full/latest variants past the 6h job
timeout (see run 24516158412).

Applies to release.yaml (docker-images, docker-web) and
release-beta.yaml (docker-images).
- docker-images-build/merge → docker-images (caller)
- docker-web-build/merge → docker-web (caller)
- notify-discord.needs updated to new job names
- Net: -190 LOC in release.yaml docker section
- docker-images-build/merge → docker-images (caller)
- Net: -110 LOC in release-beta.yaml docker section
Replaces runs-on: ubuntu-latest across all workflows.
No behavioral change today (ubuntu-latest currently maps to 24.04),
but prevents silent OS promotion to 26.04 creating arch divergence
with the explicit ubuntu-24.04-arm runner.
…kflow

GHA evaluates expressions in \`with.*\` at caller scope, where \`matrix\` is
not defined. Callers now use {{name}}, {{suffix}}, {{is_latest}},
{{is_variant}} placeholders; reusable workflow resolves them in a shell
step at merge-job matrix-expansion time before passing to metadata-action.
@vanducng vanducng force-pushed the ci/docker-multiarch-dry branch from b6047d0 to def97dc Compare April 17, 2026 16:49
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