Skip to content

Commit

Permalink
fix: Version issue on workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
dogukanoksuz committed Dec 26, 2023
1 parent b551238 commit 0a87fb8
Showing 1 changed file with 3 additions and 26 deletions.
29 changes: 3 additions & 26 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,7 @@ jobs:
run: |
VERSION=`cat storage/VERSION`
echo "RELEASE_VER=$(echo $VERSION)" >> $GITHUB_ENV
echo "RELEASE_RUNNUMBER=$(echo $GITHUB_RUN_NUMBER)" >> $GITHUB_ENV
# 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'
echo "RELEASE_RUNNUMBER=$(echo ($GITHUB_RUN_NUMBER+874))" >> $GITHUB_ENV
# Set up BuildKit Docker container builder to be able to build
# multi-platform images and export cache
Expand Down Expand Up @@ -68,22 +60,7 @@ jobs:
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.RELEASE_VER }}-${{ env.RELEASE_RUNNUMBER }}
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.RELEASE_VER }}-${{ env.RELEASE_RUNNUMBER }}, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

# Sign the resulting Docker image digest except on PRs.
# This will only write to the public Rekor transparency log when the Docker
# repository is public to avoid leaking data. If you would like to publish
# 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: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.RELEASE_VER }}-${{ env.RELEASE_RUNNUMBER }}
DIGEST: ${{ steps.build-and-push.outputs.digest }}
# This step uses the identity token to provision an ephemeral certificate
# against the sigstore community Fulcio instance.
run: echo "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.RELEASE_VER }}-${{ env.RELEASE_RUNNUMBER }}" | xargs -I {} cosign sign --yes {}@${DIGEST}
cache-to: type=gha,mode=max

0 comments on commit 0a87fb8

Please sign in to comment.