bcgov/Conditional Container Builder with Fallback

Build if trigger conditions are met, else use fallback image

View on GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Stale
License
None
namedescriptionrequireddefault
packagePackage name; e.g. backend, frontendyes
build_contextBuild context, not required for self-contained package/default directory
build_fileDockerfile with path, not required for self-contained package/default directory
sbomGenerate a Software Bill of Materials (SBOM) for the container image. Enabled by default for better security practices.true
tag_fallbackWhere to pull default images from; e.g. prod, test
tagsDefault tag(s); e.g. pr#, test, prod. Supports multiline input for multiple tags. Example: | pr123 demo test ${{ github.event.number }}
triggersPaths used to trigger a build; e.g. ('./backend/' './frontend/)
build_argsA list of build-time variables, generally not advisableBUILDKIT_INLINE_CACHE=1
diff_branchBranch to diff against${{ github.event.repository.default_branch }}
repositoryNon-default repo to clone${{ github.repository }}
github_tokenSpecify token (GH or PAT), instead of inheriting one from the calling workflow${{ github.token }}
usernameUsername for registry login; defaults to github.actor${{ github.actor }}
secretsMultiline input for secrets to mount. https://docs.docker.com/build/ci/github-actions/secrets/#secret-mounts Example: | MY_SECRET=secret_value ANOTHER_SECRET=another_value
metadata_tagsEnable automatic tag and label generation using docker/metadata-action. When enabled, generates tags and labels using the default rules in 'metadata_tag_rules', which you can override. String value, not boolean. Set to 'true' to enable (default). true
metadata_flavorFlavor configuration for metadata-action (e.g., 'latest=true'). Only used when metadata_tags is enabled. See: https://github.com/docker/metadata-action#flavor-input
metadata_tag_rulesCustom tag rules for metadata-action. Only used when metadata_tags is enabled. Example: | type=ref,event=branch type=semver,pattern={{version}} See: https://github.com/docker/metadata-action#tags-input type=sha,format=short type=ref,event=branch type=ref,event=pr type=raw,value=latest,enable={{is_default_branch}} type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}}
namedescription
digestImmutable digest of the image (resolved from fallback or built fresh)
triggeredDid a deployment trigger? [true|false]
labelsGenerated OCI labels from metadata-action (only when metadata_tags is enabled)
annotationsGenerated OCI annotations from metadata-action (only when metadata_tags is enabled)
registry_hostThe registry host name, always `ghcr.io`
image_pathThe full image path including the tag, always with a leading slash, in the format `/owner/repo/image:tag` (or `/owner/repo:tag` when the package matches the repository name)