diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 63fe0fd..9566b89 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -3,7 +3,7 @@ name: build on: push: branches: docker-test - tags: v* + tags: release/v* concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -25,13 +25,16 @@ jobs: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Set Docker tag + id: tag + run: | + if [[ $GITHUB_REF == refs/tags/* ]]; then + echo "tag=${GITHUB_REF_NAME/release/}" + else + echo "tag=edge" + fi >> $GITHUB_OUTPUT - name: Build and push uses: docker/build-push-action@v6 with: push: true - tags: | - {{ if startsWith(github.ref, 'refs/tags/') }} - ghcr.io/${{ github.repository }}:{{ github.ref_name }} - {{ else }} - ghcr.io/${{ github.repository }}:edge - {{ end }} + tags: ghcr.io/${{ github.repository }}:${{ steps.tag.outputs.tag }}