Skip to content

Commit

Permalink
change versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
leonkappes committed Aug 29, 2022
1 parent 6436ba2 commit 1f6d5c6
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,12 @@ jobs:
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=sha,format=long
type=sha,format=long,enable=${{ github.ref_type != 'tag' }}
type=ref,event=branch
type=ref,event=pr
flavor: latest=true
type=semver,pattern={{version}}
type=raw,value=latest,enable={{is_default_branch}}
flavor: latest=false

# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
Expand All @@ -69,7 +71,7 @@ jobs:
uses: docker/build-push-action@v2
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
push: ${{ github.event.base_ref =='refs/heads/master' && github.ref_type == 'tag' && !startsWith(github.ref, 'refs/tags/v0.')}}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

Expand All @@ -84,4 +86,11 @@ jobs:
COSIGN_EXPERIMENTAL: "true"
# This step uses the identity token to provision an ephemeral certificate
# against the sigstore community Fulcio instance.
run: cosign sign ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:master@${{ steps.build-and-push.outputs.digest }}
run: |
tags=(
${{ steps.meta.outputs.tags }}
)
for tag in ${tags[@]} ; do
cosign sign $tag@${{ steps.build-and-push.outputs.digest }}
done

0 comments on commit 1f6d5c6

Please sign in to comment.