Repository navigation
Add a shared publish workflow for Docker images - #20
Merged
Merged
Conversation
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.
Adds
.github/workflows/shared-publish.yml, a reusable workflow that builds, pushes and attests Docker images for ghcr.io, so request-manager, backstage and Raktr stop carrying near-identical publish workflows and their own copies of thegit describeversion recipe.What changes
shared-publish.yml(workflow_call) runs three jobs:Versionchecks nothing out: a tag build gets the tag without itsv, every other build0.0.0+<sha7>. It also outputsrevision, the same seven characters.Buildruns on pull requests only, withcontents: readand no secrets, and pushes nothing.Publishruns on every other event: it logs in to ghcr.io, pushes, and writes a build provenance attestation (push-to-registry: false). It passes the Sentry token to the build on tag builds only..github/actions/docker-build: the build steps both jobs share. It checks out, names the imageghcr.io/<owner>/<repo>[/<component>]in lowercase, keeps the existing four tag rules, and passesVERSIONandREVISIONplus any extrabuild-args. The token becomes the BuildKit secretSENTRY_AUTH_TOKENwhen one is given. GHA cache is scoped per image, withprovenanceandsbomoff.imagesis a JSON list of{component, context, file?}, passed as a block scalar because the convention allows no flow maps. The default is one image from..build-argstakes extra arguments, and the optional secretsentry-auth-tokencarries the token. Theversionoutput gives the version to the caller's later jobs.docs/workflows.mddrops the build-and-push exception from "No code from a pull request runs with a write scope"; only the labeling case remains. It now says that a job calling a reusable workflow only sets the most the called jobs may hold../…action is reported, since that path resolves against the caller's checkout; the workflow's own actions are reached through$/.Docker buildjob intest.ymlbuilds a throwaway image (test/docker-build) through the composite action without pushing, and checks the image name it reports..github/actionlint.yamlignores actionlint's$/error for everyshared-*.yml, not onlyshared-checks.yml.For reviewers
contents: read,packages: write,id-token: writeandattestations: writeon theiruses:job. A called workflow can only narrow scopes, soBuildruns withcontents: read.mboldi) needs--signer-repo BSStudio/.github.Docker buildjob is the first real run of the composite action.shared-publish.ymlitself first runs when request-manager switches to it, after this is released as v1.3.0.