Skip to content

Commit 8742462

Browse files
committed
Publish version tag only for main branch
1 parent 9e8aadd commit 8742462

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

.github/workflows/publish.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Docker publish
22

33
on:
4+
workflow_dispatch:
45
push:
56
branches:
67
- next
@@ -36,17 +37,12 @@ jobs:
3637
run: |
3738
# --quiet should turn off progress bars to make logs more readable
3839
conda env create
39-
- name: Get version
40-
id: version
41-
run: |
42-
conda activate livedata
43-
echo "version=$(versioningit)" >> $GITHUB_OUTPUT
4440
4541
- name: Create tag version
4642
id: tag
4743
run: |
4844
conda activate livedata
49-
echo "tag=$(versioningit).b$(date +'%Y%m%d%H%M')" >> $GITHUB_OUTPUT
45+
echo "tag=$(versioningit)" >> $GITHUB_OUTPUT
5046
5147
- name: Create latest tag version
5248
id: latest_tag
@@ -88,7 +84,14 @@ jobs:
8884
with:
8985
context: .
9086
file: Dockerfile
91-
tags: |
92-
${{ env.REGISTRY }}/${{ github.repository }}/live_data_server:${{ steps.latest_tag.outputs.latest_tag }}
93-
${{ env.REGISTRY }}/${{ github.repository }}/live_data_server:${{ steps.tag.outputs.tag }}
87+
tags: ${{ env.REGISTRY }}/${{ github.repository }}/live_data_server:${{ steps.latest_tag.outputs.latest_tag }}
88+
push: true
89+
90+
- name: Push version tag only for main branch
91+
if: github.ref == 'refs/heads/main'
92+
uses: docker/build-push-action@v6
93+
with:
94+
context: .
95+
file: Dockerfile
96+
tags: ${{ env.REGISTRY }}/${{ github.repository }}/live_data_server:${{ steps.tag.outputs.tag }}
9497
push: true

0 commit comments

Comments
 (0)