Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 53 additions & 25 deletions .github/workflows/build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -272,29 +272,42 @@ jobs:
- name: Analyze digest artifacts
id: digests
run: |
# Read the digests from the files
DIGEST_AMD64=$(cat /tmp/digests/${{ matrix.BUILD_IMAGE }}-amd64.digest)
if [ -f /tmp/digests/${{ matrix.BUILD_IMAGE }}-arm64.digest ]; then
DIGEST_ARM64=$(cat /tmp/digests/${{ matrix.BUILD_IMAGE }}-arm64.digest)
else
DIGEST_ARM64=""
# Loop over all available architecture artifacts
ALL_DIGESTS=""
FIRST_DIGEST=""
shopt -s nullglob
for digest_file in /tmp/digests/${{ matrix.BUILD_IMAGE }}-*.digest; do
DIGEST=$(cat "$digest_file")
echo "Found digest: $DIGEST"
if [ -z "$ALL_DIGESTS" ]; then
ALL_DIGESTS="$DIGEST"
else
ALL_DIGESTS="$ALL_DIGESTS $DIGEST"
fi
if [ -z "$FIRST_DIGEST" ]; then
FIRST_DIGEST="$DIGEST"
fi
done
shopt -u nullglob
# Check if at least one digest was found
if [ -z "$FIRST_DIGEST" ]; then
echo "Error: No digest files found"
exit 1
fi
# Get the base image name from the digests (they'll be the same)
REGISTRY_IMAGE_TAG=$(echo $DIGEST_AMD64 | cut -d'@' -f1)
# Get the base image name from the first digest
REGISTRY_IMAGE_TAG=$(echo $FIRST_DIGEST | cut -d'@' -f1)
REGISTRY_IMAGE=$(echo $REGISTRY_IMAGE_TAG | cut -d':' -f1)
REGISTRY=$(echo $REGISTRY_IMAGE | cut -d'/' -f1-2)
IMAGE=$(echo $REGISTRY_IMAGE | cut -d'/' -f3)
TAG=$(echo $REGISTRY_IMAGE_TAG | cut -d':' -f2)
echo "Registry Name: $REGISTRY"
echo "Image Name: $IMAGE"
echo "Tag Name: $TAG"
echo "AMD64 Digest: $DIGEST_AMD64"
echo "ARM64 Digest: $DIGEST_ARM64"
echo "All Digests: $ALL_DIGESTS"
echo "registry=$REGISTRY" >> $GITHUB_OUTPUT
echo "image=$IMAGE" >> $GITHUB_OUTPUT
echo "tag=$TAG" >> $GITHUB_OUTPUT
echo "amd64=$DIGEST_AMD64" >> $GITHUB_OUTPUT
echo "arm64=$DIGEST_ARM64" >> $GITHUB_OUTPUT
echo "all=$ALL_DIGESTS" >> $GITHUB_OUTPUT
- name: Extract Docker metadata for final tags
id: meta
uses: docker/metadata-action@v5
Expand All @@ -316,8 +329,7 @@ jobs:
# Create the manifest list and tag it with the final tags
docker buildx imagetools create \
$TAG_ARGS \
${{ steps.digests.outputs.amd64 }} \
${{ steps.digests.outputs.arm64 }}
${{ steps.digests.outputs.all }}

eic:
name: Build ${{ matrix.BUILD_IMAGE }}${{ matrix.ENV }} on ${{ matrix.arch }}
Expand Down Expand Up @@ -511,25 +523,42 @@ jobs:
- name: Analyze digest artifacts
id: digests
run: |
# Read the digests from the files
DIGEST_AMD64=$(cat /tmp/digests/amd64.digest)
DIGEST_ARM64=$(cat /tmp/digests/arm64.digest)
# Get the base image name from the digests (they'll be the same)
REGISTRY_IMAGE_TAG=$(echo $DIGEST_AMD64 | cut -d'@' -f1)
# Loop over all available architecture artifacts
ALL_DIGESTS=""
FIRST_DIGEST=""
shopt -s nullglob
for digest_file in /tmp/digests/*.digest; do
DIGEST=$(cat "$digest_file")
echo "Found digest: $DIGEST"
if [ -z "$ALL_DIGESTS" ]; then
ALL_DIGESTS="$DIGEST"
else
ALL_DIGESTS="$ALL_DIGESTS $DIGEST"
fi
if [ -z "$FIRST_DIGEST" ]; then
FIRST_DIGEST="$DIGEST"
fi
done
shopt -u nullglob
# Check if at least one digest was found
if [ -z "$FIRST_DIGEST" ]; then
echo "Error: No digest files found"
exit 1
fi
# Get the base image name from the first digest
REGISTRY_IMAGE_TAG=$(echo $FIRST_DIGEST | cut -d'@' -f1)
REGISTRY_IMAGE=$(echo $REGISTRY_IMAGE_TAG | cut -d':' -f1)
REGISTRY=$(echo $REGISTRY_IMAGE | cut -d'/' -f1-2)
IMAGE=$(echo $REGISTRY_IMAGE | cut -d'/' -f3)
TAG=$(echo $REGISTRY_IMAGE_TAG | cut -d':' -f2)
echo "Registry Name: $REGISTRY"
echo "Image Name: $IMAGE"
echo "Tag Name: $TAG"
echo "AMD64 Digest: $DIGEST_AMD64"
echo "ARM64 Digest: $DIGEST_ARM64"
echo "All Digests: $ALL_DIGESTS"
echo "registry=$REGISTRY" >> $GITHUB_OUTPUT
echo "image=$IMAGE" >> $GITHUB_OUTPUT
echo "tag=$TAG" >> $GITHUB_OUTPUT
echo "amd64=$DIGEST_AMD64" >> $GITHUB_OUTPUT
echo "arm64=$DIGEST_ARM64" >> $GITHUB_OUTPUT
echo "all=$ALL_DIGESTS" >> $GITHUB_OUTPUT
- name: Extract Docker metadata for final tags
id: meta
uses: docker/metadata-action@v5
Expand All @@ -551,5 +580,4 @@ jobs:
# Create the manifest list and tag it with the final tags
docker buildx imagetools create \
$TAG_ARGS \
${{ steps.digests.outputs.amd64 }} \
${{ steps.digests.outputs.arm64 }}
${{ steps.digests.outputs.all }}