From db776c49fad07ddd26d0cded89e2e81642fa22e8 Mon Sep 17 00:00:00 2001 From: Daniel Rudolf Date: Sat, 17 Jun 2023 20:18:18 +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 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 76d2a62..3fd6018 100644 --- a/.github/workflows/container-auto-update.yml +++ b/.github/workflows/container-auto-update.yml @@ -73,6 +73,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 55e6740..4591b11 100644 --- a/.github/workflows/container-publish.yml +++ b/.github/workflows/container-publish.yml @@ -60,6 +60,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%% *}"