diff --git a/.gitea/workflows/cicd.yaml b/.gitea/workflows/cicd.yaml index 877d6f721e..3f41c6b675 100644 --- a/.gitea/workflows/cicd.yaml +++ b/.gitea/workflows/cicd.yaml @@ -1,7 +1,7 @@ name: Build Deploy email notification tool run-name: ${{ gitea.actor }} building new version of the email notification tool on: - push: + push: # Baut bei jedem Push (Branches + Tags) workflow_dispatch: jobs: @@ -10,9 +10,20 @@ jobs: steps: - name: Check out repository code uses: actions/checkout@v3 + - name: Login to Docker Registry run: podman login -u ${{ secrets.REGISTRY_USERNAME }} -p ${{ secrets.REGISTRY_TOKEN }} cr.ortlerstrasse.de + + - name: Set Docker Image Tag + run: | + if [[ "${{ gitea.ref }}" == refs/tags/* ]]; then + echo "TAG_NAME=${{ gitea.ref_name }}" >> $GITHUB_ENV + else + echo "TAG_NAME=latest" >> $GITHUB_ENV + fi + - name: Build Docker image - run: podman build -t cr.ortlerstrasse.de/cgo/pretix:latest . + run: podman build -t cr.ortlerstrasse.de/cgo/pretix:${{ env.TAG_NAME }} . + - name: Push Docker image - run: podman push cr.ortlerstrasse.de/cgo/pretix:latest \ No newline at end of file + run: podman push cr.ortlerstrasse.de/cgo/pretix:${{ env.TAG_NAME }} \ No newline at end of file