From cf3930e328efa3aa2f447cce48f664d69627d380 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Tue, 9 Apr 2024 16:23:59 -0400 Subject: [PATCH] github: only publish latest release images When building the container images for Packer (light and full), we should only publish them in the version being built is a release, and not a pre-release. Changing this means that both light and full latest will always be only a final release at any time. --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c15c8c6acf5..7cc03979329 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -242,10 +242,10 @@ jobs: target: release-light arch: ${{ matrix.arch }} tags: | - docker.io/hashicorp/${{ env.REPO_NAME }}:light + ${{ steps.get-product-version.output.prerelease-product-version == "" && format("docker.io/hashicorp/{0}:light", env.REPO_NAME) }} docker.io/hashicorp/${{ env.REPO_NAME }}:light-${{ env.version }} docker.io/hashicorp/${{ env.REPO_NAME }}:${{ env.version }} - public.ecr.aws/hashicorp/${{ env.REPO_NAME }}:light + ${{ steps.get-product-version.output.prerelease-product-version == "" && format("public.ecr.aws/hashicorp/{0}:light", env.REPO_NAME) }} public.ecr.aws/hashicorp/${{ env.REPO_NAME }}:light-${{ env.version }} public.ecr.aws/hashicorp/${{ env.REPO_NAME }}:${{ env.version }} dev_tags: | @@ -272,9 +272,9 @@ jobs: target: release-full arch: ${{ matrix.arch }} tags: | - docker.io/hashicorp/${{ env.REPO_NAME }}:full + ${{ steps.get-product-version.output.prerelease-product-version == "" && format("docker.io/hashicorp/{0}:full", env.REPO_NAME) }} docker.io/hashicorp/${{ env.REPO_NAME }}:full-${{ env.version }} - public.ecr.aws/hashicorp/${{ env.REPO_NAME }}:full + ${{ steps.get-product-version.output.prerelease-product-version == "" && format("public.ecr.aws/hashicorp/{0}:full", env.REPO_NAME) }} public.ecr.aws/hashicorp/${{ env.REPO_NAME }}:full-${{ env.version }} dev_tags: | docker.io/hashicorppreview/${{ env.REPO_NAME }}:full-${{ env.version }}