Skip to content

Commit 2e0c38f

Browse files
authored
ci: docker: correctly handle outputs (#250)
* Revert "ci: docker: do not override digest (#249)" This reverts commit 8202b66. * ci: docker: correct handling of outputs
1 parent 8202b66 commit 2e0c38f

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

.github/workflows/docker.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414

1515
concurrency:
1616
group: ${{ github.workflow }}-${{ github.ref }}
17-
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
17+
cancel-in-progress: true
1818

1919
env:
2020
ORG: cometbft
@@ -29,14 +29,14 @@ jobs:
2929
include:
3030
- os: ubuntu-24.04
3131
platform: linux/amd64
32-
platform_short: amd64
32+
arch: amd64
3333
- os: ubuntu-24.04-arm
3434
platform: linux/arm64
35-
platform_short: arm64
35+
arch: arm64
3636
runs-on: ${{ matrix.os }}
3737
outputs:
38-
digest_amd64: ${{ steps.build-amd64.outputs.digest }}
39-
digest_arm64: ${{ steps.build-arm64.outputs.digest }}
38+
digest_amd64: ${{ steps.capture-digest.outputs.digest_amd64 }}
39+
digest_arm64: ${{ steps.capture-digest.outputs.digest_arm64 }}
4040
steps:
4141
- uses: actions/checkout@v4
4242
with:
@@ -54,14 +54,19 @@ jobs:
5454
password: ${{ secrets.DOCKERHUB_TOKEN }}
5555

5656
- name: Build and push image
57-
id: build-${{ matrix.platform_short }}
57+
id: build
5858
uses: docker/build-push-action@v6
5959
with:
6060
platforms: ${{ matrix.platform }}
6161
file: ./tools/Dockerfile
6262
tags: |
6363
${{ env.ORG }}/${{ env.IMAGE_NAME }}:${{ env.GIT_TAG }}
6464
push: true
65+
outputs: type=image,name=${{ env.ORG }}/${{ env.IMAGE_NAME }},digest=true
66+
67+
- name: Capture Image Digest
68+
id: capture-digest
69+
run: echo "digest_${{ matrix.arch }}=${{ steps.build.outputs.digest }}" >> $GITHUB_ENV
6570

6671
merge:
6772
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)