Skip to content

Authorization Webhook #25

Authorization Webhook

Authorization Webhook #25

Workflow file for this run

name: Build and Publish Docker Image
on:
push:
branches:
- main
pull_request:
jobs:
build-and-push:
permissions:
contents: read
packages: write
attestations: write
id-token: write
runs-on: ubuntu-latest
# Define the services that should be built.
strategy:
matrix:
service:
- datum-authorization-webhook
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Log in to GitHub Container Registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/[email protected]
with:
images: ghcr.io/datum-cloud/${{ matrix.service }}
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Build ${{ matrix.service }}
id: push
uses: docker/[email protected]
with:
context: .
file: cmd/${{ matrix.service }}/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-name: ghcr.io/datum-cloud/${{ matrix.service }}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true