TASK: speed up multi-arch docker build in GH Actions#18
Merged
Conversation
Pins the builder stage to BUILDPLATFORM so Go cross-compiles to TARGETARCH natively instead of running under QEMU emulation, which was the dominant cost (arm64 stage ran ~5-10x slower in QEMU on the amd64 runner). Also drops the now-unused setup-qemu-action step, removes the -a flag and merges the two go build invocations so they share Go's compile cache, and adds -trimpath -ldflags="-s -w" for smaller, reproducible binaries.
…r-gh-actions-C1TId
The explicit Always policy (added in bd728e4) blocked e2e: kind loads the locally-built image into the node, but Always forces kubelet to pull from example.com/nats-auth-operator:v0.0.1 (a placeholder registry that does not exist), causing ErrImagePull. Removing the line restores the per-tag default (IfNotPresent for pinned tags), which is correct for kind-based testing.
Replaces the four split workflow files (docker-publish, lint, test, test-e2e) with a single ci.yml. Three behavior changes: - push trigger restricted to branches: [main] and tags: ['v*.*.*']. Previously every push to a PR branch triggered both push and pull_request events, doubling check runs on every commit. - concurrency group keyed on workflow + ref with cancel-in-progress on pull_request only. Rapid PR updates now cancel the older run automatically; main-branch runs are protected from cancellation. - pull_request now ignores docs-only changes (**.md, docs/**) so doc-only PRs skip the kind/buildx burn. QEMU setup step is also gone (no longer needed once the Dockerfile uses --platform=\$BUILDPLATFORM, applied earlier in this branch). Production publish behavior is unchanged: the docker job still gates push on event_name != pull_request.
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.
Pins the builder stage to BUILDPLATFORM so Go cross-compiles to
TARGETARCH natively instead of running under QEMU emulation, which
was the dominant cost (arm64 stage ran ~5-10x slower in QEMU on the
amd64 runner). Also drops the now-unused setup-qemu-action step,
removes the -a flag and merges the two go build invocations so they
share Go's compile cache, and adds -trimpath -ldflags="-s -w" for
smaller, reproducible binaries.