Skip to content

Commit

Permalink
Update release-container.yaml
Browse files Browse the repository at this point in the history
Better image tagging and labels, attestation
  • Loading branch information
simonkowallik authored Jul 14, 2024
1 parent c37954d commit 5cee070
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions .github/workflows/release-container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@ on:

jobs:
release-container-image:
strategy:
matrix:
containers:
- file: Dockerfile
tags: |
simonkowallik/tmconfpy:latest
ghcr.io/simonkowallik/tmconfpy:latest
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down Expand Up @@ -42,17 +35,33 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels)
id: metadata
uses: docker/metadata-action@v5
with:
images: |
${{ github.repository }}
ghcr.io/${{ github.repository }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64
file: ${{ matrix.containers.file }}
file: Dockerfile
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ matrix.containers.tags }}
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}

- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true

- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v4
with:
Expand Down

0 comments on commit 5cee070

Please sign in to comment.