Skip to content

Switch to structured logging. (#83) #2

Switch to structured logging. (#83)

Switch to structured logging. (#83) #2

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*.*.*'
permissions:
contents: read
jobs:
release:
name: Build and Release OCI Image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
attestations: write
steps:
- name: Checkout repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- name: Extract version from tag
id: version
run: |
# Extract the tag name (e.g., v1.0.0)
TAG=${GITHUB_REF#refs/tags/}
echo "tag=${TAG}" >> $GITHUB_OUTPUT
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Log in to GitHub Container Registry
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
id: push
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
context: .
file: ./Dockerfile
push: true
tags: ghcr.io/github/artifact-attestations-opa-provider:${{ steps.version.outputs.tag }}
platforms: linux/amd64,linux/arm64
- name: Attest build provenance
uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3.0.0
with:
subject-name: ghcr.io/github/artifact-attestations-opa-provider
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true