Skip to content

Commit 24de4e9

Browse files
authored
Use image digest in release manifest (#8)
1 parent f85245b commit 24de4e9

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

.github/workflows/release.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ jobs:
8686
fi
8787
8888
- name: Build and push image (latest version)
89+
id: build_latest
8990
if: steps.version.outputs.is_latest == 'true'
9091
uses: docker/build-push-action@v6
9192
with:
@@ -100,6 +101,7 @@ jobs:
100101
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
101102
102103
- name: Build and push image (none latest version)
104+
id: build_non_latest
103105
if: steps.version.outputs.is_latest == 'false'
104106
uses: docker/build-push-action@v6
105107
with:
@@ -120,10 +122,19 @@ jobs:
120122
- name: Generate installation manifest
121123
run: |
122124
GIT_SHA=$(git rev-parse --short HEAD)
125+
126+
# Use digest from whichever build step ran (latest or non-latest)
127+
if [ "${{ steps.version.outputs.is_latest }}" == "true" ]; then
128+
IMAGE_DIGEST="${{ steps.build_latest.outputs.digest }}"
129+
else
130+
IMAGE_DIGEST="${{ steps.build_non_latest.outputs.digest }}"
131+
fi
132+
123133
make build-installer \
124-
IMG=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.full }} \
134+
IMG=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@${IMAGE_DIGEST} \
125135
VERSION_LABEL=v${{ steps.version.outputs.full }} \
126136
GIT_SHA_LABEL=${GIT_SHA}
137+
127138
mv dist/install.yaml func-operator.yaml
128139
129140
- name: Create GitHub Release

0 commit comments

Comments
 (0)