Skip to content

Commit 1f1572b

Browse files
committed
update workflows
1 parent 0f88e84 commit 1f1572b

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

.github/workflows/docker-publish.yml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name: Docker
77

88
on:
99
schedule:
10-
- cron: '37 16 * * *'
10+
- cron: '44 1 * * *'
1111
push:
1212
branches: [ "master" ]
1313
# Publish semver tags as releases.
@@ -41,20 +41,21 @@ jobs:
4141
# https://github.com/sigstore/cosign-installer
4242
- name: Install cosign
4343
if: github.event_name != 'pull_request'
44-
uses: sigstore/cosign-installer@v3.3.0
44+
uses: sigstore/cosign-installer@6e04d228eb30da1757ee4e1dd75a0ec73a653e06 #v3.1.1
4545
with:
46-
cosign-release: 'v2.2.2'
46+
cosign-release: 'v2.1.1'
4747

48-
49-
# Workaround: https://github.com/docker/build-push-action/issues/461
50-
- name: Setup Docker buildx
51-
uses: docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf
48+
# Set up BuildKit Docker container builder to be able to build
49+
# multi-platform images and export cache
50+
# https://github.com/docker/setup-buildx-action
51+
- name: Set up Docker Buildx
52+
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
5253

5354
# Login against a Docker registry except on PR
5455
# https://github.com/docker/login-action
5556
- name: Log into registry ${{ env.REGISTRY }}
5657
if: github.event_name != 'pull_request'
57-
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
58+
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
5859
with:
5960
registry: ${{ env.REGISTRY }}
6061
username: ${{ github.actor }}
@@ -64,15 +65,15 @@ jobs:
6465
# https://github.com/docker/metadata-action
6566
- name: Extract Docker metadata
6667
id: meta
67-
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
68+
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
6869
with:
6970
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
7071

7172
# Build and push Docker image with Buildx (don't push on PR)
7273
# https://github.com/docker/build-push-action
7374
- name: Build and push Docker image
7475
id: build-and-push
75-
uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a
76+
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
7677
with:
7778
context: .
7879
push: ${{ github.event_name != 'pull_request' }}
@@ -93,7 +94,9 @@ jobs:
9394
- name: Sign the published Docker image
9495
if: ${{ github.event_name != 'pull_request' }}
9596
env:
96-
COSIGN_EXPERIMENTAL: "true"
97+
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
98+
TAGS: ${{ steps.meta.outputs.tags }}
99+
DIGEST: ${{ steps.build-and-push.outputs.digest }}
97100
# This step uses the identity token to provision an ephemeral certificate
98101
# against the sigstore community Fulcio instance.
99-
run: echo "${{ steps.meta.outputs.tags }}" | xargs -I {} cosign sign {}@${{ steps.build-and-push.outputs.digest }}
102+
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}

0 commit comments

Comments
 (0)