Skip to content

Commit

Permalink
Update docker-build-template.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ytqsl authored Feb 5, 2024
1 parent 6a21903 commit 72c32f8
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/docker-build-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# 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@v3.2.0
uses: sigstore/cosign-installer@v3.4.0
with:
cosign-release: "v2.2.1"

Expand All @@ -58,7 +58,7 @@ jobs:
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/[email protected].0
uses: docker/[email protected].1
with:
images: ${{ inputs.REGISTRY }}/${{ inputs.IMAGE_NAME }}
tags: |
Expand All @@ -68,7 +68,7 @@ jobs:
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v5.0.0
uses: docker/build-push-action@v5.1.0
with:
context: ${{ inputs.IMAGE_CONTEXT }}
file: ${{ inputs.IMAGE_FILE }}
Expand All @@ -78,14 +78,14 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max

# # Sign the resulting Docker image digest except on PRs.
# # 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 }}
# 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 "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
# Sign the resulting Docker image digest except on PRs.
# 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 }}
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 "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}

0 comments on commit 72c32f8

Please sign in to comment.