diff --git a/create-manifest.sh b/create-manifest.sh index 68df712..ad86c6d 100755 --- a/create-manifest.sh +++ b/create-manifest.sh @@ -26,16 +26,24 @@ if ! docker manifest inspect ${IMAGE_AMD64} &>/dev/null || ! docker manifest ins exit 1 fi -# Create the multi-architecture manifest for the commit ID -echo "πŸ“œ Creating multi-architecture manifest for ${COMMIT_ID}..." -docker manifest create ${IMAGE_MULTI} ${IMAGE_AMD64} ${IMAGE_ARM64} --amend +# πŸ›‘ Remove the old multi-architecture manifest to prevent duplicates +echo "πŸ—‘οΈ Removing existing manifest list for ${IMAGE_MULTI} (if exists)..." +docker manifest rm ${IMAGE_MULTI} || true # Ignore errors if it doesn’t exist -# Push the multi-arch manifest for the commit ID +echo "πŸ—‘οΈ Removing existing manifest list for ${IMAGE_LATEST} (if exists)..." +docker manifest rm ${IMAGE_LATEST} || true # Ignore errors if it doesn’t exist + +# πŸ—οΈ Create the new multi-architecture manifest +echo "πŸ“œ Creating new multi-architecture manifest for ${COMMIT_ID}..." +docker manifest create ${IMAGE_MULTI} ${IMAGE_AMD64} ${IMAGE_ARM64} + +# πŸš€ Push the multi-arch manifest for the commit ID docker manifest push ${IMAGE_MULTI} echo "βœ… Successfully pushed multi-arch manifest: ${IMAGE_MULTI}" -# Create and push the latest multi-architecture manifest -echo "πŸ”„ Updating latest multi-architecture manifest..." -docker manifest create ${IMAGE_LATEST} ${IMAGE_AMD64} ${IMAGE_ARM64} --amend +# πŸ”„ Create and push the latest multi-architecture manifest +echo "πŸ“œ Creating new latest multi-architecture manifest..." +docker manifest create ${IMAGE_LATEST} ${IMAGE_AMD64} ${IMAGE_ARM64} docker manifest push ${IMAGE_LATEST} echo "βœ… Successfully updated latest manifest: ${IMAGE_LATEST}" +