From a9047f6ab20f6b98680632def3c0e370b2070f2f Mon Sep 17 00:00:00 2001 From: Teddy Knox Date: Thu, 9 Nov 2023 16:34:20 -0500 Subject: [PATCH] Attempt 4 --- .github/workflows/docker-publish.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 3696e508dbc91..b5d1519060e8d 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -53,8 +53,16 @@ jobs: - name: Finalize Docker Metadata id: docker_tagging run: | - # The same logic for tagging as in your original workflow... - # ... [Your previous logic here] + if [[ "${{ github.event_name }}" == 'schedule' ]]; then + echo "cron trigger, assigning nightly tag" + echo "docker_tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:nightly,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:nightly-${GITHUB_SHA}" >> $GITHUB_OUTPUT + elif [[ "${GITHUB_REF##*/}" == "main" ]] || [[ ${GITHUB_REF##*/} == "master" ]]; then + echo "manual trigger from master/main branch, assigning latest tag" + echo "docker_tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${GITHUB_REF##*/},${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest" >> $GITHUB_OUTPUT + else + echo "Neither scheduled nor manual release from main branch. Just tagging as branch name" + echo "docker_tags=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${GITHUB_REF##*/}" >> $GITHUB_OUTPUT + fi - name: Inspect Docker Metadata run: |