From e02660b58b6198f282354af53fa352b92bb7414c Mon Sep 17 00:00:00 2001 From: Wesley B <62723358+wesleyboar@users.noreply.github.com> Date: Wed, 5 Jun 2024 18:17:36 -0500 Subject: [PATCH] chore(.github): workflow parity with tacc-docs (#34) * chore: github workflow parity with tacc-docs - __renamed__ `SHORTSHA` to `SHORT_SHA` - __renamed__ `BRANCH_SHORT` to `SHORT_REF` - __renamed__ `branch_short` to `ref_short` * feat(.github): custom docker tag i.e. `next` * fix(.github): tag_custom choice not respected * fix(.github): tag_custom usage typo * fix(.github): tag_custom used as repo and tag --- .github/workflows/build.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e7aee246..1972bbf7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,17 +27,17 @@ jobs: run: | if [ -z "$EVENT_SHA" ]; then SHORT_SHA=${GITHUB_SHA::8}; else SHORT_SHA=${EVENT_SHA::8}; fi echo ::set-output name=sha_short::${SHORT_SHA} - BRANCH_SHORT=`git symbolic-ref --short HEAD | sed 's/[^[:alnum:]\.\_\-]/-/g'` - echo ::set-output name=branch_short::${BRANCH_SHORT} + SHORT_REF=`git symbolic-ref --short HEAD | sed 's/[^[:alnum:]\.\_\-]/-/g'` + echo ::set-output name=ref_short::${SHORT_REF} env: EVENT_SHA: ${{ github.event.client_payload.sha }} - name: Print vars run: | - echo $SHORTSHA - echo $BRANCH_SHORT + echo $SHORT_SHA + echo $SHORT_REF env: - SHORTSHA: ${{ steps.vars.outputs.sha_short }} - BRANCH_SHORT: ${{ steps.vars.outputs.branch_short }} + SHORT_SHA: ${{ steps.vars.outputs.sha_short }} + SHORT_REF: ${{ steps.vars.outputs.ref_short }} - name: Login to Docker Hub uses: docker/login-action@v2 @@ -49,7 +49,7 @@ jobs: uses: docker/build-push-action@v3 with: push: true - tags: designsafeci/ds-user-guide:latest,designsafeci/ds-user-guide:${{ steps.vars.outputs.sha_short }},designsafeci/ds-user-guide:${{ steps.vars.outputs.branch_short }}${{ inputs.tag_custom && ',designsafeci/ds-user-guide:' }}${{ inputs.tag_custom }} + tags: designsafeci/ds-user-guide:latest,designsafeci/ds-user-guide:${{ steps.vars.outputs.sha_short }},designsafeci/ds-user-guide:${{ steps.vars.outputs.ref_short }}${{ inputs.tag_custom && ',designsafeci/ds-user-guide:' }}${{ inputs.tag_custom }} - name: Post build status in slack id: slack