Skip to content

Commit 9c2bcf9

Browse files
committed
Export additional outputs from the Docker image build workflow
1 parent 7d66704 commit 9c2bcf9

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

.github/workflows/ensure_sync_service_image.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,18 @@ on:
1515
type: string
1616
default: linux/amd64
1717
outputs:
18-
image:
18+
image_ref:
1919
description: 'Full image ref'
20+
value: ${{ jobs.build_image.outputs.image_ref }}
21+
image:
22+
description: 'The repository part of the image, without the tag'
2023
value: ${{ jobs.build_image.outputs.image }}
24+
tag:
25+
description: 'Only the tag part'
26+
value: ${{ jobs.build_image.outputs.tag }}
27+
digest:
28+
description: 'The sha256 digest for the image produced by Docker builder'
29+
value: ${{ jobs.build_image.outputs.digest }}
2130

2231
jobs:
2332
build_image:
@@ -35,7 +44,10 @@ jobs:
3544
packages: write
3645

3746
outputs:
47+
image_ref: ${{ steps.out.outputs.image_ref }}
3848
image: ${{ steps.out.outputs.image }}
49+
tag: ${{ steps.out.outputs.tag }}
50+
digest: ${{ steps.build.outputs.digest }}
3951

4052
steps:
4153
- uses: actions/checkout@v4
@@ -82,6 +94,7 @@ jobs:
8294

8395
- name: Build and push if missing
8496
if: steps.exists.outputs.exists != 'true'
97+
id: build
8598
uses: docker/build-push-action@v6
8699
with:
87100
context: packages/sync-service
@@ -98,4 +111,6 @@ jobs:
98111
- name: Output image ref
99112
id: out
100113
run: |
101-
echo "image=${IMAGE}:${TAG}" >> $GITHUB_OUTPUT
114+
echo "image_ref=${IMAGE}:${TAG}" >> $GITHUB_OUTPUT
115+
echo "image=${IMAGE}" >> $GITHUB_OUTPUT
116+
echo "tag=${TAG}" >> $GITHUB_OUTPUT

.github/workflows/ts_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
run:
7777
working-directory: ${{ matrix.package_dir }}
7878
env:
79-
ELECTRIC_IMAGE: ${{ needs.ensure_sync_service_image.outputs.image }}
79+
ELECTRIC_IMAGE: ${{ needs.ensure_sync_service_image.outputs.image_ref }}
8080
steps:
8181
- uses: actions/checkout@v4
8282

0 commit comments

Comments
 (0)