6565 - image : ic-dev
6666 target : dev
6767 outputs :
68- imageid : ${{ steps.set-imageid.outputs.imageid }} # both images share the same imageid
68+ ic-build-imageid : ${{ steps.set-output-imageid.outputs.ic-build-imageid }}
69+ ic-dev-imageid : ${{ steps.set-output-imageid.outputs.ic-dev-imageid }}
6970 steps :
7071 - name : Checkout
7172 uses : actions/checkout@v4
@@ -92,10 +93,17 @@ jobs:
9293 target : ${{ matrix.target }}
9394 build-args : |
9495 CI_USER=1001
95- - name : Set imageid output
96- id : set-imageid
97- if : matrix.image == 'ic-build'
98- run : echo "imageid=${{ steps.build.outputs.imageid }}" >> $GITHUB_OUTPUT
96+ - name : Set output imageid
97+ id : set-output-imageid
98+ run : |
99+ if [ "${{ matrix.image }}" == "ic-build" ]; then
100+ echo "ic-build-imageid=${{ steps.build.outputs.imageid }}" >> $GITHUB_OUTPUT
101+ elif [ "${{ matrix.image }}" == "ic-dev" ]; then
102+ echo "ic-dev-imageid=${{ steps.build.outputs.imageid }}" >> $GITHUB_OUTPUT
103+ else
104+ echo "Unknown image: ${{ matrix.image }}"
105+ exit 1
106+ fi
99107
100108 update-image-references :
101109 name : Update Image References in Repo
@@ -122,21 +130,26 @@ jobs:
122130 # Update container image references
123131 set -xeuo pipefail
124132
125- IMG_NAME=${{ github.repository_owner }}/ic-build
126- IMG_NAME_FULL="ghcr.io/${IMG_NAME}@${{ needs.ic-build-image.outputs.imageid }}"
133+
134+ IMAGE_PREFIX="ghcr.io/dfinity/"
135+ IMG_NAME_IC_BUILD="${IMAGE_PREFIX}ic-build@${{ needs.ic-build-image.outputs.ic-build-imageid }}"
136+ IMG_NAME_IC_DEV="${IMAGE_PREFIX}ic-dev@${{ needs.ic-build-image.outputs.ic-dev-imageid }}"
127137
128138 echo '${{ needs.build-image-prep.outputs.image_tag }}' > ci/container/TAG
129139 pushd .devcontainer
130- sed -i -E "s|(ghcr.io/)?$IMG_NAME (:\|@)[^\"]{5,}|$IMG_NAME_FULL |g" -- *
140+ sed -i -E "s|${IMAGE_PREFIX}ic-dev (:\|@)[^\"]{5,}|$IMG_NAME_IC_DEV |g" -- *
131141 popd
132142 pushd .github
133- sed -i -E "s|(ghcr.io/)?$IMG_NAME (:\|@)[^\"]{5,}|$IMG_NAME_FULL |g" -- workflow*/*
143+ sed -i -E "s|${IMAGE_PREFIX}ic-build (:\|@)[^\"]{5,}|$IMG_NAME_IC_BUILD |g" -- workflow*/*
134144 popd
135145
136146 git config --global user.name "IDX GitHub Automation"
137147 git config --global user.email "<>"
138148 git add .
139- git commit -m 'Updating container image to ${{ needs.ic-build-image.outputs.imageid }}' -m 'Image tag: ${{ needs.build-image-prep.outputs.image_tag }}'
149+ git commit \
150+ -m 'Updating container images to tag: ${{ needs.build-image-prep.outputs.image_tag }}' \
151+ -m 'ic-build: ${{ needs.ic-build-image.outputs.ic-build-imageid }}' \
152+ -m 'ic-dev: ${{ needs.ic-build-image.outputs.ic-dev-imageid }}'
140153 git push
141154
142155 - name : Add PR Comment
@@ -145,8 +158,9 @@ jobs:
145158 with :
146159 script : |
147160 let message = 'Run URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\n\n'
148- message += 'New container image: `${{ needs.ic-build-image.outputs.imageid }}`\n'
149- message += 'New container tag: `${{ needs.build-image-prep.outputs.image_tag }}`'
161+ message += 'New container images with tag: `${{ needs.build-image-prep.outputs.image_tag }}`\n'
162+ message += 'ic-build: `${{ needs.ic-build-image.outputs.ic-build-imageid }}`\n'
163+ message += 'ic-dev: `${{ needs.ic-build-image.outputs.ic-dev-imageid }}`\n'
150164
151165 // Find existing comment from this workflow
152166 const comments = await github.rest.issues.listComments({
0 commit comments