Skip to content

Commit

Permalink
ci: display image digest on the job summary (#532)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mogyuchi authored Sep 3, 2024
1 parent 24af25e commit 94fedf4
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ jobs:
EOF
EOS
- name: Build and push Docker image
- id: build-push
name: Build and push Docker image
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: .
Expand All @@ -73,3 +74,15 @@ jobs:
labels: ${{ steps.labels.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

- if: ${{ github.event_name != 'pull_request' }}
name: Display image digest
env:
NAME: ${{ fromJson(steps.build-push.outputs.metadata)['image.name'] }}
DIGEST: ${{ fromJson(steps.build-push.outputs.metadata)['containerimage.digest'] }}
run: |
name=$(cut --delimiter=',' --fields=1 <<< "$NAME")
echo '```' >> $GITHUB_STEP_SUMMARY
echo "$name@$DIGEST" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY

0 comments on commit 94fedf4

Please sign in to comment.