Repository navigation
ci: publish images through GHCR and the image mirror - #250
Merged
Merged
Conversation
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
There was a problem hiding this comment.
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
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.
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/assertoorwith the job's GitHub token. Each job that pushes attests what it pushed and has the mirror copy it to Docker Hub, pinned toethpandaops/actions/mirror-image@738aeadbcdc54f1c9af659d35f8ef29dd5c0fae6:<prefix>-<arch>,<prefix>-<sha>-<arch>) and mirror them by the digestdocker pushreports.<prefix>-<sha>by the digestdocker buildx imagetools create --metadata-filereports.attest-platformsstays at its default.<tag>,<tag>-amd64and<tag>-arm64by the digests its threeimagetools createcalls report.ubuntu-latest, arm64 onubuntu-24.04-arm).packages: write,id-token: writeandattestations: write. Every job that calls_shared-build.yamlgrants the same, because GitHub checks a called workflow's job permissions against its caller even for jobs that end up skipped._shared-build.yamltakes theIMAGE_MIRROR_URLsecret instead ofDOCKERHUB_USERNAME/DOCKERHUB_TOKEN, anddocker_repositoryis nowghcr.io/ethpandaops/assertoor.build-master.ymlnow usesconcurrency: docker-<workflow>-<ref>withcancel-in-progress: false, so a push to master waits for the previous build instead of cancelling it partway through pushing and mirroring themastertags.build-dev-latest.yml(manual; pushes themastertags andlatest) is converted the same way, and gets the samedocker-<workflow>-<ref>concurrency group withcancel-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 labelledbuild-docker-image(built onpull_requestsynchronize) publishpr-<number>,pr-<number>-latest,pr-<number>-<sha>and their-amd64/-arm64variants instead of tags named after the PR's branch. A branch name could otherwise overwrite any existing tag, such asmasteror a release. Anyone pulling PR images by branch name switches topr-<number>; anyone who needs a branch-named devnet tag can dispatchbuild-dev.ymlwithdocker_tag.Manual dev tags can't use reserved names.
build-dev.ymlnow refuses adocker_tagthat ismaster,main,latestorpr, starts with one of them followed by-, or starts withv<digit>, and only accepts letters, digits,_,.and-(up to 101 characters). Write slashes as-, for examplefeat-xinstead offeat/x.Once a build has gone through the mirror, this repo's
DOCKERHUB_USERNAMEandDOCKERHUB_TOKENsecrets can be removed (not removed in this PR).actionlint (with shellcheck) reports no new findings.