Skip to content

Commit

Permalink
Merge pull request #3 from devfullcycle/feature/add-semver-tag-format
Browse files Browse the repository at this point in the history
add semver tag and rebuild on dockerfile change
  • Loading branch information
argentinaluiz authored Oct 6, 2023
2 parents d681020 + c7fca3a commit 3a6a565
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ env:

jobs:
build:

if: ${{ github.event_name != 'pull_request' && contains(github.event.head_commit, 'Dockerfile')}}
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -36,7 +36,6 @@ jobs:
# Install the cosign tool except on PR
# https://github.com/sigstore/cosign-installer
- name: Install cosign
if: github.event_name != 'pull_request'
uses: sigstore/cosign-installer@6e04d228eb30da1757ee4e1dd75a0ec73a653e06 #v3.1.1
with:
cosign-release: 'v2.1.1'
Expand Down Expand Up @@ -64,6 +63,8 @@ jobs:
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags:
type=semver,pattern={{version}},value=v1.0.0

# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
Expand All @@ -84,7 +85,6 @@ jobs:
# transparency data even for private images, pass --force to cosign below.
# https://github.com/sigstore/cosign
- name: Sign the published Docker image
if: ${{ github.event_name != 'pull_request' }}
env:
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
TAGS: ${{ steps.meta.outputs.tags }}
Expand Down

0 comments on commit 3a6a565

Please sign in to comment.