Skip to content

Commit

Permalink
Merge pull request #40 from CUAHSI/add-branch-name-to-image-tag
Browse files Browse the repository at this point in the history
Add-branch-name-to-image-tag
  • Loading branch information
devincowan authored Mar 18, 2024
2 parents d854182 + 2e6dd64 commit 608a1a7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/workflows/trigger-build-on-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ env:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
REPOSITORY: ${{ secrets.DOCKER_REPOSITORY }}
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}

on:
push:
Expand Down Expand Up @@ -63,12 +64,15 @@ jobs:
- name: Echo env configuration and set image tag
id: tagging
run: |
echo "IMAGE_VARIANT: ${{ matrix.IMAGE_VARIANT }}"
echo "JH_BASE: ${{ env.JH_BASE }}"
echo "CUAHSI_BASE: ${{ env.CUAHSI_BASE }}"
echo "BUILD_DATE: ${{ env.BUILD_DATE }}"
echo "GITHUB_SHA: $GITHUB_SHA"
echo "BRANCH_NAME: $BRANCH_NAME"
echo ------------
export DOCKER_TAG="${REPOSITORY}/${IMAGE_ROOT}-${{ matrix.IMAGE_VARIANT }}:${{ env.CUAHSI_BASE }}"
export DOCKER_FULL_PATH="$DOCKER_TAG-$GITHUB_SHA-built_on_$(date +'%Y.%m.%d')"
export DOCKER_FULL_PATH="$DOCKER_TAG-$BRANCH_NAME-$GITHUB_SHA-built_on_$(date +'%Y.%m.%d')"
echo "DOCKER_FULL_PATH=$DOCKER_FULL_PATH" >> $GITHUB_ENV
echo $DOCKER_FULL_PATH
docker tag $DOCKER_TAG $DOCKER_FULL_PATH
Expand Down

0 comments on commit 608a1a7

Please sign in to comment.