Skip to content

Commit

Permalink
feat: improved docker publish action
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNaubit committed Jun 30, 2024
1 parent b134bff commit 811c6fd
Showing 1 changed file with 11 additions and 21 deletions.
32 changes: 11 additions & 21 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
name: Docker

on:
push:
tags: ["v*.*.*"]
pull_request:
branches: ["main"]
workflow_dispatch:
release:
types:
- published

env:
REGISTRY: docker.io
Expand Down Expand Up @@ -55,8 +53,8 @@ jobs:
tags: |
# set latest tag for main branch
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
type=ref,event=branch
type=ref,event=pr
# type=ref,event=branch
# type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
Expand All @@ -76,17 +74,9 @@ jobs:
provenance: mode=max
sbom: true
# https://docs.github.com/en/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds#generating-build-provenance-for-container-images
# - name: Generate artifact attestation
# uses: actions/attest-build-provenance@v1
# with:
# subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# subject-digest: 'sha256:fedcba0...'
# push-to-registry: true

# - name: Docker Hub Description
# uses: peter-evans/dockerhub-description@v3
# if: ${{ github.event_name != 'pull_request' }}
# with:
# username: ${{ env.REGISTRY_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
# repository: ${{ env.IMAGE_NAME }}
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
subject-digest: ${{ steps.build-and-push.outputs.digest }}
push-to-registry: true

0 comments on commit 811c6fd

Please sign in to comment.