Skip to content

Track package downloads #61

Track package downloads

Track package downloads #61

Workflow file for this run

name: Publish Docker image
on:
push:
branches:
- 'main'
- 'develop'
tags:
- 'v*'
jobs:
publish-images:
name: Publish Docker Images
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
packages: write
attestations: write
steps:
-
name: Check out repo
uses: actions/checkout@v4
-
name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
-
name: Login to GitHub Packages
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push Docker image
id: push
uses: docker/build-push-action@v4
with:
context: .
file: ./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/${{ github.repository }}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true