From db07e74ed198042056ac64bc54e9d7016339678e Mon Sep 17 00:00:00 2001 From: James Jones Date: Sat, 4 Mar 2023 10:45:47 -0500 Subject: [PATCH] Removing the dnf cache and condensing this a bit --- .github/workflows/build.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fa50cb6..439da02 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -89,8 +89,12 @@ jobs: VERSION=$(echo "${GITHUB_REF_NAME}" | sed 's|/|-|g') fi podman build . --file Dockerfile --tag "${{ matrix.registry }}/$IMAGE_NAME:$VERSION" --build-arg ARTIFACTORY=${{ matrix.registry_proxy }} - podman push "${{ matrix.registry }}/$IMAGE_NAME:$VERSION" - if [[ "$GITHUB_REF" =~ ^refs/tags.* ]]; then - podman tag "${{ matrix.registry }}/$IMAGE_NAME:$VERSION" "${{ matrix.registry }}/$IMAGE_NAME:latest" - podman push "${{ matrix.registry }}/$IMAGE_NAME:latest" + if [[ "$GITHUB_REF" =~ ^refs/pull.* ]]; then + echo "Pull requests do not get published. Only for testing" + else + podman push "${{ matrix.registry }}/$IMAGE_NAME:$VERSION" + if [[ "$GITHUB_REF" =~ ^refs/tags.* ]]; then + podman tag "${{ matrix.registry }}/$IMAGE_NAME:$VERSION" "${{ matrix.registry }}/$IMAGE_NAME:latest" + podman push "${{ matrix.registry }}/$IMAGE_NAME:latest" + fi fi