From 9e11393ef97c9b300eed08ea80aac07bb9c441ba Mon Sep 17 00:00:00 2001 From: Daniel Rudolf Date: Sat, 17 Jun 2023 20:44:46 +0200 Subject: [PATCH] GitHub workflows: Delete base image before pushing container images This is a workaround for https://github.com/redhat-actions/push-to-registry confusing the just built image with the base image; see https://github.com/redhat-actions/push-to-registry/issues/66 --- .github/workflows/container-auto-update.yml | 6 ++++++ .github/workflows/container-publish.yml | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/.github/workflows/container-auto-update.yml b/.github/workflows/container-auto-update.yml index 6f28dd7..28bf636 100644 --- a/.github/workflows/container-auto-update.yml +++ b/.github/workflows/container-auto-update.yml @@ -69,6 +69,12 @@ jobs: run: | buildah unshare ./build.sh + # Workaround for https://github.com/redhat-actions/push-to-registry/issues/66 + - name: Delete base image + if: ${{ env.BUILD_ACTION != '' }} + run: | + podman rmi "$(. ./container.env ; echo "$BASE_IMAGE")" + - name: Container image metadata run: | "$CI_TOOLS_PATH/containers/get-metadata.sh" "$REGISTRY/$OWNER" "$IMAGE:latest" diff --git a/.github/workflows/container-publish.yml b/.github/workflows/container-publish.yml index 557aaf5..ea574b9 100644 --- a/.github/workflows/container-publish.yml +++ b/.github/workflows/container-publish.yml @@ -56,6 +56,11 @@ jobs: run: | buildah unshare ./build.sh + # Workaround for https://github.com/redhat-actions/push-to-registry/issues/66 + - name: Delete base image + run: | + podman rmi "$(. ./container.env ; echo "$BASE_IMAGE")" + - name: Container image metadata run: | podman image inspect "localhost/$IMAGE:${TAGS%% *}"