Reusable GitHub Actions workflows for Codemowers projects. Call them from a
tagged version, for example @v2.2.0, and grant packages: write to the calling
job.
oci-image.yamlbuilds linux/amd64 and linux/arm64 on native runners and scans both with Trivy. Forv*tags it pushes each architecture by digest, joins the digests into an image index tagged with the release tag and commit SHA, and recordsNAME@DIGESTfor the chart.helm-chart.yamllints and renders the chart on every call. ForvMAJOR.MINOR.PATCH[-PRERELEASE]tags it replaces eachimage: NAME:latestvalues line with the image index digest from the same run, setsimageRegistry: ghcr.io/<owner>, and pushes the chart, versioned from the tag, tooci://ghcr.io/<owner>/charts. KeepChart.yamlat a placeholder version such as0.1.0in Git.
Optional inputs: labels adds OCI labels, fail-on-severity (for example
HIGH,CRITICAL) fails builds with fixable vulnerabilities, submodules is
passed to checkout, and no-cache rebuilds every layer. For the chart,
registry-key names the registry values key (default imageRegistry); set it
empty to write full ghcr.io/<owner>/NAME@DIGEST references. Tagged chart
runs also upload the package as the helm-chart artifact.
Several images: call oci-image.yaml once per image, for example from a
matrix job, and list them all in images.
jobs:
checks:
runs-on: ubuntu-latest
steps: [] # project tests
image:
needs: checks
uses: codemowers/workflows/.github/workflows/oci-image.yaml@v2.2.0
permissions: {contents: read, packages: write}
with:
image: example
chart:
needs: image
uses: codemowers/workflows/.github/workflows/helm-chart.yaml@v2.2.0
permissions: {contents: read, packages: write}
with:
images: exampleAction and Helm versions are pinned here. Release changes under a new immutable tag; callers move to it once a tagged release has published cleanly.