Skip to content

ci: publish images through GHCR and the image mirror - #250

Merged
samcm merged 2 commits into
masterfrom
image-mirror
Nov 23, 2026
Merged

samcm merged 2 commits into
masterfrom
image-mirror

Conversation

@samcm

@samcm samcm commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Moves this repo's image builds off the Docker Hub token and onto the org image mirror.

The images are now pushed to ghcr.io/ethpandaops/assertoor with the job's GitHub token. Each job that pushes attests what it pushed and has the mirror copy it to Docker Hub, pinned to ethpandaops/actions/mirror-image@738aeadbcdc54f1c9af659d35f8ef29dd5c0fae6:

  • The amd64 and arm64 jobs push the same two tags as before (<prefix>-<arch>, <prefix>-<sha>-<arch>) and mirror them by the digest docker push reports.
  • The multiarch job mirrors <prefix>-<sha> by the digest docker buildx imagetools create --metadata-file reports. attest-platforms stays at its default.
  • Each additional-tag job mirrors its <tag>, <tag>-amd64 and <tag>-arm64 by the digests its three imagetools create calls report.
  • All builders are GitHub-hosted (amd64 on ubuntu-latest, arm64 on ubuntu-24.04-arm).
  • The pushing jobs get packages: write, id-token: write and attestations: write. Every job that calls _shared-build.yaml grants the same, because GitHub checks a called workflow's job permissions against its caller even for jobs that end up skipped.
  • _shared-build.yaml takes the IMAGE_MIRROR_URL secret instead of DOCKERHUB_USERNAME/DOCKERHUB_TOKEN, and docker_repository is now ghcr.io/ethpandaops/assertoor.
  • build-master.yml now uses concurrency: docker-<workflow>-<ref> with cancel-in-progress: false, so a push to master waits for the previous build instead of cancelling it partway through pushing and mirroring the master tags.
  • build-dev-latest.yml (manual; pushes the master tags and latest) is converted the same way, and gets the same docker-<workflow>-<ref> concurrency group with cancel-in-progress: false.

Docker Hub image names and tags stay exactly the same; only the way they get there changes.

PR builds now use pr-<number> tags. Same-repo PRs labelled build-docker-image (built on pull_request synchronize) publish pr-<number>, pr-<number>-latest, pr-<number>-<sha> and their -amd64/-arm64 variants instead of tags named after the PR's branch. A branch name could otherwise overwrite any existing tag, such as master or a release. Anyone pulling PR images by branch name switches to pr-<number>; anyone who needs a branch-named devnet tag can dispatch build-dev.yml with docker_tag.

Manual dev tags can't use reserved names. build-dev.yml now refuses a docker_tag that is master, main, latest or pr, starts with one of them followed by -, or starts with v<digit>, and only accepts letters, digits, _, . and - (up to 101 characters). Write slashes as -, for example feat-x instead of feat/x.

Once a build has gone through the mirror, this repo's DOCKERHUB_USERNAME and DOCKERHUB_TOKEN secrets can be removed (not removed in this PR).

actionlint (with shellcheck) reports no new findings.

Push images to ghcr.io/ethpandaops/assertoor with the job's GitHub token,
attest them and have the org image mirror copy them to Docker Hub,
instead of pushing to Docker Hub with a long-lived token. Docker Hub
names and tags stay the same.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1fe9d-2766-7248-b50d-465e39d90ce2

@redpandabot redpandabot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Moves image publishing from Docker Hub credentials to GHCR with per-job attestation plus org image-mirror copies, adds pr-<number> tags for PR builds, and serialises master builds instead of cancelling them mid-push. I checked the diff against the pinned mirror-image action's real interface and against all five _shared-build.yaml call sites; the digest capture, metadata-file parsing, permission grants and the Docker Hub tag set all line up, and I found no behaviour that is wrong or would break the build/publish flow.


Reviewed 5 changed file(s) @ 807e0882 — no blocking issues found.
"Friday deploys are a personality flaw."

Manual build-dev docker_tag values must be valid docker tags (letters,
digits, _ . -) and must not be master, main, latest or pr, start with
one of them followed by -, or start with v<digit>.

build-dev-latest now queues behind a running build instead of cancelling
it, like build-master.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1fe9d-2766-7248-b50d-465e39d90ce2
@samcm
samcm merged commit b035eef into master Nov 23, 2026
10 checks passed
@samcm
samcm deleted the image-mirror branch November 23, 2026 02:33
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