Skip to content

Commit

Permalink
Publish version tag only for main branch
Browse files Browse the repository at this point in the history
  • Loading branch information
rosswhitfield committed Jun 23, 2024
1 parent 9e8aadd commit 8742462
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Docker publish

on:
workflow_dispatch:
push:
branches:
- next
Expand Down Expand Up @@ -36,17 +37,12 @@ jobs:
run: |
# --quiet should turn off progress bars to make logs more readable
conda env create
- name: Get version
id: version
run: |
conda activate livedata
echo "version=$(versioningit)" >> $GITHUB_OUTPUT
- name: Create tag version
id: tag
run: |
conda activate livedata
echo "tag=$(versioningit).b$(date +'%Y%m%d%H%M')" >> $GITHUB_OUTPUT
echo "tag=$(versioningit)" >> $GITHUB_OUTPUT
- name: Create latest tag version
id: latest_tag
Expand Down Expand Up @@ -88,7 +84,14 @@ jobs:
with:
context: .
file: Dockerfile
tags: |
${{ env.REGISTRY }}/${{ github.repository }}/live_data_server:${{ steps.latest_tag.outputs.latest_tag }}
${{ env.REGISTRY }}/${{ github.repository }}/live_data_server:${{ steps.tag.outputs.tag }}
tags: ${{ env.REGISTRY }}/${{ github.repository }}/live_data_server:${{ steps.latest_tag.outputs.latest_tag }}
push: true

- name: Push version tag only for main branch
if: github.ref == 'refs/heads/main'
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile
tags: ${{ env.REGISTRY }}/${{ github.repository }}/live_data_server:${{ steps.tag.outputs.tag }}
push: true

0 comments on commit 8742462

Please sign in to comment.