michielvha/Build and release a Docker Image

A reusable action to build and release Docker images with automatic version detection

View on GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Activelast commit Jun 6, 2026
License
Apache 2.0

Pinned Snippet

workflow.ymlSHA-pinned
uses: michielvha/docker-release-action@e7bb601b3297b74c958e4f36fef697f28febbadc # v1

tags can be moved; commit SHAs can't. why a SHA?

namedescriptionrequireddefault
versionGitVersion version to usenodev
usernameDocker Hub usernameyes
passwordDocker Hub password or tokenyes
projectDocker image name (e.g., edgeforge/erm)yes
platformsTarget platforms for Docker buildnolinux/amd64
contextDocker build contextno.
build-argsAdditional build arguments to pass to Docker build (multiline string, e.g., "ARG1=value1\nARG2=value2"). IMAGE_NAME will be automatically set to the project name.no
registryoptionally specify any OCI complaint registry, common ones include docker.io, ghcr.io, gcr.io, quay.io, defaults to docker hub.docker.io
cache-fromList of external cache sources for BuildKit (e.g. "type=gha,scope=my-workflow"). Leave empty to disable caching.no""
cache-toList of cache export destinations for BuildKit (e.g. "type=gha,scope=my-workflow,mode=max"). Leave empty to disable caching.no""
secret-filesBuildKit secret files to mount during build (e.g., "netrc=.netrc"). Maps directly to docker/build-push-action secret-files input. Use with RUN --mount=type=secret in Dockerfiles.no""
matrix-modeEnable native multi-platform matrix builds. Use "build" in each matrix leg to push a single-platform image by digest, then "merge" in a follow-up job to combine digests into a multi-arch manifest. Leave empty for default single-job behavior (backward compatible).no""
trivy-scanEnable Trivy vulnerability scanning of the built imagenotrue
trivy-severityTrivy severity levels to report (comma-separated)noHIGH,CRITICAL
trivy-exit-codeExit code when vulnerabilities are found (0 = report only, 1 = fail)no0
trivy-formatTrivy output format (table, json, sarif, cyclonedx, spdx-json) - sarif requires `security-events: write` permission and GHAS enabled (pro feature)notable
cosign-signEnable Sigstore keyless signing (cosign sign) of the pushed image digest. Requires the calling job to declare `id-token: write` permission. Opt-in for backward compatibility.nofalse
sbomGenerate an SPDX-JSON SBOM for the built image with Syft and upload it as a workflow artifact. Opt-in for backward compatibility.nofalse
attest-provenanceProduce a SLSA build-provenance attestation (actions/attest-build-provenance) bound to the pushed image digest. Requires the calling job to declare `id-token: write` + `attestations: write` permissions. Opt-in.nofalse
attest-sbomProduce an SBOM attestation (actions/attest-sbom) bound to the pushed image digest. Requires `id-token: write` + `attestations: write` permissions and `sbom: true`. Opt-in.nofalse
vexPath to an OpenVEX document (https://openvex.dev) to attach to the released image. Leave empty to skip. The document is authored/maintained out-of-band (e.g. with vexctl) and committed to the calling repository.no""
attest-vexProduce an OpenVEX attestation (actions/attest, predicate-type https://openvex.dev/ns/v0.2.0) bound to the pushed image digest. Requires `id-token: write` + `attestations: write` permissions and a non-empty `vex` path. Opt-in for backward compatibility.nofalse
namedescription
image-digestDocker image digest of the pushed manifest (default-mode build) or single-platform leg (build-mode). For merge-mode, see release-digest.
release-digestDigest of the final released artifact: the manifest in merge-mode, the pushed image in default mode, empty in build-mode.