diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 3578744..2972540 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -36,23 +36,34 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + - name: Get the Ref + id: get-ref + uses: https://github.com/ankitvgupta/ref-to-tag-action@master + with: + ref: ${{ github.ref }} + head_ref: ${{ github.head_ref }} + + - name: lowercase repo name + run: | + echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV} + - name: Build and push (pull_request) uses: docker/build-push-action@v6 if: github.event_name == 'pull_request' with: push: true - tags: ${{ github.repository }}:sha_${{ github.sha }},${{ github.repository }}:pr_${{ github.head_ref }} + tags: git.dominikstahl.dev/${{ env.REPO }}:sha_${{ github.sha }},git.dominikstahl.dev/${{ env.REPO }}:${{ steps.get-ref.outputs.tag}} - name: Build and push (push_tag) uses: docker/build-push-action@v6 if: github.event_name == 'push' && github.ref_type == 'tag' with: push: true - tags: ${{ github.repository }}:${{ github.ref_name }},${{ github.repository }}:latest + tags: git.dominikstahl.dev/${{ env.REPO }}:${{ steps.get-ref.outputs.tag }},git.dominikstahl.dev/${{ env.REPO }}:latest - name: Build and push (push_branch) uses: docker/build-push-action@v6 if: github.event_name == 'push' && github.ref_type == 'branch' with: push: true - tags: ${{ github.repository }}:sha_${{ github.sha }},${{ github.repository }}:main + tags: git.dominikstahl.dev/${{ env.REPO }}:sha_${{ github.sha }},git.dominikstahl.dev/${{ env.REPO }}:main