Skip to content

Commit

Permalink
Tag before upload to have the same container digest
Browse files Browse the repository at this point in the history
  • Loading branch information
almet committed Nov 27, 2024
1 parent 6d78e3b commit 41afa0f
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/release-container-image.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This action listens on new tags, generates a new container image
# sign it and upload it to the container registry.

name: Publish container image
name: Release container image
on:
push:
tags:
Expand Down Expand Up @@ -40,11 +40,15 @@ jobs:
sudo apt-get install -y python3-poetry
python3 ./install/common/build-image.py
echo ${{ github.token }} | podman login ghcr.io -u USERNAME --password-stdin
# Load the image with the final name directly
gunzip -c share/container.tar.gz | podman load
podman push \
dangerzone.rocks/dangerzone \
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
DIGEST=$(podman images --filter "reference=dangerzone.rocks/dangerzone" --format "{{ .Digest }}")
FINAL_IMAGE_NAME="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}"
podman tag dangerzone.rocks/dangerzone "$FINAL_IMAGE_NAME"
podman push "$FINAL_IMAGE_NAME"
# Get digest of the pushed image using the final name
DIGEST=$(podman inspect --format='{{.Digest}}' "$FINAL_IMAGE_NAME")
echo "Digest: ${DIGEST}"
echo "digest=${DIGEST}" >> "$GITHUB_OUTPUT"
Expand Down

0 comments on commit 41afa0f

Please sign in to comment.