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.
sdk_bump
Lucas Bajolet 2 years ago committed by Lucas Bajolet
parent fed91012ab
commit 3f083fe8ea

@ -40,7 +40,7 @@ jobs:
outputs: outputs:
product-version: ${{ steps.set-product-version.outputs.product-version }} product-version: ${{ steps.set-product-version.outputs.product-version }}
base-product-version: ${{ steps.set-product-version.outputs.base-product-version }} base-product-version: ${{ steps.set-product-version.outputs.base-product-version }}
product-date: ${{ steps.get-product-version.outputs.product-date }} product-date: ${{ steps.set-product-version.outputs.product-date }}
product-prerelease-version: ${{ steps.set-product-version.outputs.prerelease-product-version }} product-prerelease-version: ${{ steps.set-product-version.outputs.prerelease-product-version }}
set-ld-flags: ${{ steps.set-ld-flags.outputs.set-ld-flags }} set-ld-flags: ${{ steps.set-ld-flags.outputs.set-ld-flags }}
steps: steps:
@ -242,10 +242,10 @@ jobs:
target: release-light target: release-light
arch: ${{ matrix.arch }} arch: ${{ matrix.arch }}
tags: | tags: |
docker.io/hashicorp/${{ env.REPO_NAME }}:light ${{ steps.set-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 }}:light-${{ env.version }}
docker.io/hashicorp/${{ env.REPO_NAME }}:${{ env.version }} docker.io/hashicorp/${{ env.REPO_NAME }}:${{ env.version }}
public.ecr.aws/hashicorp/${{ env.REPO_NAME }}:light ${{ steps.set-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 }}:light-${{ env.version }}
public.ecr.aws/hashicorp/${{ env.REPO_NAME }}:${{ env.version }} public.ecr.aws/hashicorp/${{ env.REPO_NAME }}:${{ env.version }}
dev_tags: | dev_tags: |
@ -272,9 +272,9 @@ jobs:
target: release-full target: release-full
arch: ${{ matrix.arch }} arch: ${{ matrix.arch }}
tags: | tags: |
docker.io/hashicorp/${{ env.REPO_NAME }}:full ${{ steps.set-product-version.output.prerelease-product-version == '' && format('docker.io/hashicorp/{0}:full', env.REPO_NAME) }}
docker.io/hashicorp/${{ env.REPO_NAME }}:full-${{ env.version }} docker.io/hashicorp/${{ env.REPO_NAME }}:full-${{ env.version }}
public.ecr.aws/hashicorp/${{ env.REPO_NAME }}:full ${{ steps.set-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 }} public.ecr.aws/hashicorp/${{ env.REPO_NAME }}:full-${{ env.version }}
dev_tags: | dev_tags: |
docker.io/hashicorppreview/${{ env.REPO_NAME }}:full-${{ env.version }} docker.io/hashicorppreview/${{ env.REPO_NAME }}:full-${{ env.version }}

Loading…
Cancel
Save