Skip to content

refactor(auth): switch to the canonical go-oidc + oauth2 pattern #133

refactor(auth): switch to the canonical go-oidc + oauth2 pattern

refactor(auth): switch to the canonical go-oidc + oauth2 pattern #133

Workflow file for this run

name: Docker
on:
push:
branches: ['**'] # every branch: pushes an image tagged with the branch name for testing
tags: ['v*']
pull_request:
branches: [main, master]
env:
REGISTRY: ghcr.io
# Run JS-based actions on Node 24 now (silences the Node 20 deprecation warning)
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
build:
name: Build and Push (${{ matrix.component }})
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
strategy:
fail-fast: false
matrix:
include:
- component: api
image: ${{ github.repository }}
dockerfile: Dockerfile
- component: operator
image: ${{ github.repository }}-operator
dockerfile: Dockerfile.operator
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ matrix.image }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha,prefix=sha-
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push
id: build
uses: docker/build-push-action@v6
with:
context: .
file: ${{ matrix.dockerfile }}
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=${{ matrix.component }}
cache-to: type=gha,mode=max,scope=${{ matrix.component }}
# Generate the SBOM (and provenance) during the build and attach them to
# the pushed image as OCI attestations — no fragile registry re-pull.
sbom: true
provenance: mode=max