Skip to content

Commit 98fec14

Browse files
committed
ci(build-devcontainer): compute image vars for display and job summary; remove redundant output step
Use local image_name/image_tag/image_url in the "Display build parameters" step and job summary, add the image URL to the summary table, and remove the duplicated "Output image details" step. Signed-off-by: Aaron Wislang <[email protected]>
1 parent 39a1de2 commit 98fec14

File tree

1 file changed

+9
-23
lines changed

1 file changed

+9
-23
lines changed

.github/workflows/build-devcontainer.yml

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,17 @@ jobs:
4343

4444
- name: Display build parameters
4545
run: |
46+
devcontainer="${{ github.event.inputs.devcontainer_choice }}"
47+
image_name="${devcontainer%-container}"
48+
image_tag="${{ github.event.inputs.image_tag || 'latest' }}"
49+
image_url="ghcr.io/${{ github.repository }}/${image_name}:${image_tag}"
50+
4651
echo "::group::🔧 Build Configuration"
4752
echo "DevContainer: ${{ github.event.inputs.devcontainer_choice }}"
48-
echo "Image Tag: ${{ github.event.inputs.image_tag || 'latest' }}"
53+
echo "Image Tag: ${image_tag}"
4954
echo "Platform: ${{ matrix.platform }}"
5055
echo "Build Arguments: ${{ github.event.inputs.build_args || '(none)' }}"
56+
echo "Image: ${image_url}"
5157
echo "::endgroup::"
5258
5359
# Add to job summary
@@ -56,9 +62,10 @@ jobs:
5662
echo "| Parameter | Value |" >> $GITHUB_STEP_SUMMARY
5763
echo "| --- | --- |" >> $GITHUB_STEP_SUMMARY
5864
echo "| **DevContainer** | \`${{ github.event.inputs.devcontainer_choice }}\` |" >> $GITHUB_STEP_SUMMARY
59-
echo "| **Image Tag** | \`${{ github.event.inputs.image_tag || 'latest' }}\` |" >> $GITHUB_STEP_SUMMARY
65+
echo "| **Image Tag** | \`${image_tag}\` |" >> $GITHUB_STEP_SUMMARY
6066
echo "| **Platform** | \`${{ matrix.platform }}\` |" >> $GITHUB_STEP_SUMMARY
6167
echo "| **Build Arguments** | \`${{ github.event.inputs.build_args || '(none)' }}\` |" >> $GITHUB_STEP_SUMMARY
68+
echo "| **Image** | \`${image_url}\` |" >> $GITHUB_STEP_SUMMARY
6269
echo "" >> $GITHUB_STEP_SUMMARY
6370
6471
- name: Log in to GitHub Container Registry
@@ -182,24 +189,3 @@ jobs:
182189
- name: Inspect multi-arch image
183190
run: |
184191
docker buildx imagetools inspect ghcr.io/${{ github.repository }}/${{ steps.image-name.outputs.name }}:${{ github.event.inputs.image_tag || 'latest' }}
185-
186-
- name: Output image details
187-
run: |
188-
echo "Built devcontainer: ${{ github.event.inputs.devcontainer_choice }}"
189-
echo "Tags: ${{ steps.meta.outputs.tags }}"
190-
191-
# Add to job summary
192-
echo "## 🐳 DevContainer Build Complete" >> $GITHUB_STEP_SUMMARY
193-
echo "" >> $GITHUB_STEP_SUMMARY
194-
echo "**Container:** \`${{ github.event.inputs.devcontainer_choice }}\`" >> $GITHUB_STEP_SUMMARY
195-
echo "**Tags:**" >> $GITHUB_STEP_SUMMARY
196-
echo '```' >> $GITHUB_STEP_SUMMARY
197-
echo "${{ steps.meta.outputs.tags }}" >> $GITHUB_STEP_SUMMARY
198-
echo '```' >> $GITHUB_STEP_SUMMARY
199-
echo "" >> $GITHUB_STEP_SUMMARY
200-
echo "**Platforms:** \`linux/amd64\`, \`linux/arm64/v8\`" >> $GITHUB_STEP_SUMMARY
201-
echo "" >> $GITHUB_STEP_SUMMARY
202-
echo "### Pull Command" >> $GITHUB_STEP_SUMMARY
203-
echo '```bash' >> $GITHUB_STEP_SUMMARY
204-
echo "docker pull ghcr.io/${{ github.repository }}/${{ steps.image-name.outputs.name }}:${{ github.event.inputs.image_tag || 'latest' }}" >> $GITHUB_STEP_SUMMARY
205-
echo '```' >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)