Skip to content

Commit

Permalink
Conditional tag if feature branch
Browse files Browse the repository at this point in the history
  • Loading branch information
dickwolff authored Feb 1, 2024
1 parent 6888f19 commit 75097d4
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,22 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set GitVersion tag if main mranch
run: |
echo "DOCKER_TAG=dickwolff/export-to-ghostfolio:${{ env.GitVersion_MajorMinorPatch }}" >> $GITHUB_ENV
if: ${{ github.event_name != 'pull_request' }}

- name: Set GitVersion tag if feature branch
run: |
echo "DOCKER_TAG=dickwolff/export-to-ghostfolio:${{ env.GitVersion_MajorMinorPatch }}-beta" >> $GITHUB_ENV
if: ${{ github.event_name == 'pull_request' }}

- name: Build and push
uses: docker/build-push-action@v5
env:
GITVERSION_TAG: ${{ github.event_name != 'pull_request' }}
with:
push: ${{ github.event_name != 'pull_request' }}
tags: |
dickwolff/export-to-ghostfolio:latest
dickwolff/export-to-ghostfolio:${{ env.GitVersion_MajorMinorPatch }}
${{ env.DOCKER_TAG }}

0 comments on commit 75097d4

Please sign in to comment.