Skip to content

Commit d02fdea

Browse files
committed
build: update github action
1 parent 1e40112 commit d02fdea

File tree

1 file changed

+22
-21
lines changed

1 file changed

+22
-21
lines changed

.github/workflows/docker-publish.yml

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -35,38 +35,40 @@ jobs:
3535

3636
steps:
3737
- name: Checkout repository
38-
uses: actions/checkout@v3
38+
uses: actions/checkout@v4
3939
with:
4040
submodules: recursive
4141

4242
# Install the cosign tool except on PR
4343
# https://github.com/sigstore/cosign-installer
4444
- name: Install cosign
4545
if: github.event_name != 'pull_request'
46-
uses: sigstore/cosign-installer@f3c664df7af409cb4873aa5068053ba9d61a57b6 #v2.6.0
46+
uses: sigstore/cosign-installer@v3.7.0
4747
with:
48-
cosign-release: 'v1.13.1'
49-
50-
51-
# Workaround: https://github.com/docker/build-push-action/issues/461
52-
- name: Setup Docker buildx
53-
uses: docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf
48+
cosign-release: 'v2.4.1' # optional
5449

5550
# Login against a Docker registry except on PR
5651
# https://github.com/docker/login-action
5752
- name: Log into registry ${{ env.REGISTRY }}
5853
if: github.event_name != 'pull_request'
59-
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
54+
uses: docker/login-action@v3
6055
with:
6156
registry: ${{ env.REGISTRY }}
6257
username: ${{ github.actor }}
6358
password: ${{ secrets.GITHUB_TOKEN }}
6459

60+
- name: Set up QEMU
61+
uses: docker/setup-qemu-action@v3
62+
63+
# Workaround: https://github.com/docker/build-push-action/issues/461
64+
- name: Setup Docker buildx
65+
uses: docker/setup-buildx-action@v3
66+
6567
# Extract metadata (tags, labels) for Docker
6668
# https://github.com/docker/metadata-action
6769
- name: Extract Docker metadata
6870
id: meta
69-
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
71+
uses: docker/metadata-action@v5
7072
with:
7173
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
7274
tags: |
@@ -82,7 +84,7 @@ jobs:
8284
# https://github.com/docker/build-push-action
8385
- name: Build and push Docker image
8486
id: build-and-push
85-
uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a
87+
uses: docker/build-push-action@v6
8688
with:
8789
context: base-os
8890
platforms: linux/amd64,linux/arm64
@@ -92,16 +94,15 @@ jobs:
9294
cache-from: type=gha
9395
cache-to: type=gha,mode=max
9496

95-
9697
# Sign the resulting Docker image digest except on PRs.
97-
# This will only write to the public Rekor transparency log when the Docker
98-
# repository is public to avoid leaking data. If you would like to publish
99-
# transparency data even for private images, pass --force to cosign below.
100-
# https://github.com/sigstore/cosign
101-
- name: Sign the published Docker image
98+
- name: Sign the images with GitHub OIDC Token
10299
if: ${{ github.event_name != 'pull_request' }}
103100
env:
104-
COSIGN_EXPERIMENTAL: "true"
105-
# This step uses the identity token to provision an ephemeral certificate
106-
# against the sigstore community Fulcio instance.
107-
run: echo "${{ steps.meta.outputs.tags }}" | xargs -I {} cosign sign {}@${{ steps.build-and-push.outputs.digest }}
101+
DIGEST: ${{ steps.build-and-push.outputs.digest }}
102+
TAGS: ${{ steps.meta.outputs.tags }}
103+
run: |
104+
images=""
105+
for tag in ${TAGS}; do
106+
images+="${tag}@${DIGEST} "
107+
done
108+
cosign sign --yes ${images}

0 commit comments

Comments
 (0)