diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index c28fb51..7edc787 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -143,6 +143,24 @@ jobs: - name: Create and push DockerHub manifest run: | + wait_for_remote_image() { + local image_ref="$1" + local attempts=18 + local sleep_seconds=10 + + for ((i=1; i<=attempts; i++)); do + if docker buildx imagetools inspect "$image_ref" >/dev/null 2>&1; then + return 0 + fi + + echo "[$i/$attempts] Waiting for $image_ref to become available..." + sleep "$sleep_seconds" + done + + echo "Timed out waiting for $image_ref" + return 1 + } + GIT_SHA="$(git rev-parse HEAD)" if [ "${GITHUB_EVENT_NAME}" = "workflow_dispatch" ]; then REF_TYPE="branch" @@ -173,6 +191,24 @@ jobs: - name: Create and push GitHub Container Registry manifest run: | + wait_for_remote_image() { + local image_ref="$1" + local attempts=18 + local sleep_seconds=10 + + for ((i=1; i<=attempts; i++)); do + if docker buildx imagetools inspect "$image_ref" >/dev/null 2>&1; then + return 0 + fi + + echo "[$i/$attempts] Waiting for $image_ref to become available..." + sleep "$sleep_seconds" + done + + echo "Timed out waiting for $image_ref" + return 1 + } + GIT_SHA="$(git rev-parse HEAD)" if [ "${GITHUB_EVENT_NAME}" = "workflow_dispatch" ]; then REF_TYPE="branch"