From 9ee3dfabaeefbc4dbd38bac460319ad000d95e7a Mon Sep 17 00:00:00 2001 From: Ryan Birmingham Date: Fri, 7 Oct 2022 14:40:39 -0400 Subject: [PATCH] Viewer and branch should match name --- .github/workflows/container.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml index c91bcf2..c0d92c6 100644 --- a/.github/workflows/container.yml +++ b/.github/workflows/container.yml @@ -7,7 +7,7 @@ name: Container Publish on: push: - branches: ['master', 'develop'] + branches: ['master', 'develop', 'fda/htt'] env: REGISTRY: ghcr.io @@ -24,6 +24,19 @@ jobs: - name: Checkout repository uses: actions/checkout@v2 + - name: Get branch name (merge) + if: github.event_name != 'pull_request' + shell: bash + run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV + + - name: Get branch name (pull request) + if: github.event_name == 'pull_request' + shell: bash + run: echo "BRANCH_NAME=$(echo ${GITHUB_HEAD_REF} | tr / -)" >> $GITHUB_ENV + + - name: Debug branch name steps + run: echo ${{ env.BRANCH_NAME }} + - name: Log in to the Container registry uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 with: @@ -41,6 +54,8 @@ jobs: uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc with: context: . + build-args: | + "viewer=${{ env.BRANCH_NAME }}" push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }}