|
# Build kubernetes oriented docker images using skaffold (see /skaffold.yaml and |
|
# k8s/README.md for details). |
|
# |
|
# This is currently an experimental feature, see: k8s/experimental.yaml |
|
|
|
name: k8s |
|
on: |
|
# Trigger on any PR, however note that we filter |
|
# PRs down to PRs where the source-branch is *k8s* using `if:` blocks below. |
|
# |
|
# Deploys come from Kargo, which watches the cdo-rails registry and writes |
|
# the deployment values files. |
|
pull_request: |
|
workflow_dispatch: |
|
|
|
jobs: |
|
# Step 1: build platform specific docker images: amd64, arm64, using `skaffold build` |
|
skaffold-build: |
|
if: github.event_name != 'pull_request' || contains(github.head_ref, 'k8s') |
|
name: skaffold build |
|
uses: ./.github/workflows/k8s-skaffold-build.yml |
|
with: |
|
source_commit_sha: ${{ github.event.pull_request.head.sha || github.sha }} |
|
# only run on PRs where the source branch is *k8s*: |
|
secrets: inherit |
|
|
|
# Step 2: stitch the platform specific images into a multi-platform image |
|
stitch-multiplatform-image: |
|
name: stitch multi-platform image |
|
uses: ./.github/workflows/k8s-stitch-multiplatform-image.yml |
|
needs: skaffold-build |
|
with: |
|
branch_tag_alias: ${{ github.head_ref || github.ref_name }} |
|
docker_tags_json: ${{ toJSON(needs.skaffold-build.outputs) }} |
|
docker_tag: ${{ needs.skaffold-build.outputs.docker_tag }} |
|
secrets: inherit |
|
|
|
# In parallel with skaffold: verify our kustomize and helm packages, etc |
|
validate: |
|
if: github.event_name != 'pull_request' || contains(github.head_ref, 'k8s') |
|
name: validate |
|
uses: ./.github/workflows/k8s-validate.yml |
|
|
|
# Grant the GITHUB_TOKEN the necessary permissions for checkout and publishing to GitHub Packages |
|
permissions: |
|
# permission to checkout this repo in the build workflow |
|
contents: read |
|
# permission to publish container images to ghcr.io |
|
packages: write |