diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 297c72e..cba0a30 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,8 +1,10 @@ name: Docker publish on: + workflow_dispatch: push: branches: + - publish_build - next - qa - main @@ -36,24 +38,19 @@ 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 run: | case ${{ github.ref }} in - refs/heads/next) + refs/heads/publish_build) echo "latest_tag=latest-dev" >> $GITHUB_OUTPUT ;; @@ -88,7 +85,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/tags/publish_build' + uses: docker/build-push-action@v6 + with: + context: . + file: Dockerfile + tags: ${{ env.REGISTRY }}/${{ github.repository }}/live_data_server:${{ steps.tag.outputs.tag }} push: true