Skip to content

v1.1.0

v1.1.0 #4

name: Publish Docker Image
on:
release:
types: [published]
# Allow the workflow to be triggered manually
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build_and_push_image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
# v4.1.7
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Log in to GHCR
# v3.3.0
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
# v5.5.1
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
# v6.5.0
uses: docker/build-push-action@5176d81f87c23d6fc96624dfdbcd9f3830bbe445
with:
context: .
push: true
tags: |
${{ steps.meta.outputs.tags }}
${{ github.sha }}
labels: ${{ steps.meta.outputs.labels }}
file: Dockerfile.release
- name: Generate artifact attestation
# v1.4.0
uses: actions/attest-build-provenance@210c1913531870065f03ce1f9440dd87bc0938cd
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true