From 90cd311c8fc91cd967900f6c464617cb119ad859 Mon Sep 17 00:00:00 2001 From: sowm9802 Date: Fri, 8 Nov 2024 20:43:23 +0530 Subject: [PATCH] Add DEF_TAG_NAME to env in release-heat-rxt.yml to fix empty imageTag issue --- .github/workflows/release-heat-rxt.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-heat-rxt.yml b/.github/workflows/release-heat-rxt.yml index 07b8eadc..34dfd88a 100644 --- a/.github/workflows/release-heat-rxt.yml +++ b/.github/workflows/release-heat-rxt.yml @@ -23,6 +23,7 @@ on: env: REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} + DEF_TAG_NAME: 2024.1-ubuntu_jammy # There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu. jobs: @@ -42,6 +43,10 @@ jobs: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + # ghcr only allows lowercase repository names + - name: lowercase repo name + run: | + echo "IMAGE_NAME=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV} # This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels. - name: Extract metadata (tags, labels) for Docker id: meta @@ -60,8 +65,8 @@ jobs: file: Containerfiles/HeatRXT-Containerfile push: true tags: | - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/heat-rxt:${{ github.event.inputs.imageTag }} - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/heat-rxt:${{ github.event.inputs.imageTag }}-${{ env.MY_DATE }} + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/heat-rxt:${{ github.event.inputs.imageTag || env.DEF_TAG_NAME }} + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/heat-rxt:${{ github.event.inputs.imageTag || env.DEF_TAG_NAME }}-${{ env.MY_DATE }} labels: ${{ steps.meta.outputs.labels }} build-args: | - VERSION=${{ github.event.inputs.imageTag }} + VERSION=${{ github.event.inputs.imageTag || env.DEF_TAG_NAME }}