Skip to content

Commit ba2f9b9

Browse files
authored
Merge pull request #141 from camicroscope/viewer-mach-wf
Viewer and branch should match name
2 parents 48ed2f0 + 9ee3dfa commit ba2f9b9

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

.github/workflows/container.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name: Container Publish
77

88
on:
99
push:
10-
branches: ['master', 'develop']
10+
branches: ['master', 'develop', 'fda/htt']
1111

1212
env:
1313
REGISTRY: ghcr.io
@@ -24,6 +24,19 @@ jobs:
2424
- name: Checkout repository
2525
uses: actions/checkout@v2
2626

27+
- name: Get branch name (merge)
28+
if: github.event_name != 'pull_request'
29+
shell: bash
30+
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
31+
32+
- name: Get branch name (pull request)
33+
if: github.event_name == 'pull_request'
34+
shell: bash
35+
run: echo "BRANCH_NAME=$(echo ${GITHUB_HEAD_REF} | tr / -)" >> $GITHUB_ENV
36+
37+
- name: Debug branch name steps
38+
run: echo ${{ env.BRANCH_NAME }}
39+
2740
- name: Log in to the Container registry
2841
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
2942
with:
@@ -41,6 +54,8 @@ jobs:
4154
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
4255
with:
4356
context: .
57+
build-args: |
58+
"viewer=${{ env.BRANCH_NAME }}"
4459
push: true
4560
tags: ${{ steps.meta.outputs.tags }}
4661
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)