diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6a3294a9..909fac15 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -102,9 +102,6 @@ jobs: platforms: linux/amd64,linux/arm64,linux/arm/v7 steps: - - name: Set tag - id: vars - run: echo "{tag}={$(echo ${GITHUB_REF:10})}" >> $GITHUB_STATE && echo "{type}={$(echo ${GITHUB_REF:5})}" >> $GITHUB_STATE - name: Checkout uses: actions/checkout@v3 - uses: actions/download-artifact@v3 @@ -136,7 +133,8 @@ jobs: push: true tags: bpatrik/pigallery2:experimental-${{ matrix.container }} - name: Push nightly on new master commit - if: ${{ startsWith(steps.vars.outputs.type , 'head') && !github.event.issue.pull_request && github.ref == 'refs/heads/master' }} + # github.ref: branches the format is refs/heads/ PRs and Tags are different + if: ${{github.ref == 'refs/heads/master' }} uses: docker/build-push-action@v3 with: context: . @@ -145,7 +143,7 @@ jobs: push: true tags: bpatrik/pigallery2:nightly-${{ matrix.container }} - name: Push release on new Tag - if: ${{ startsWith(steps.vars.outputs.type , 'tag') && !github.event.issue.pull_request && matrix.container != 'debian-bullseye'}} + if: ${{ startsWith(github.ref_type , 'tag') && !github.event.issue.pull_request && matrix.container != 'debian-bullseye'}} uses: docker/build-push-action@v3 with: context: . @@ -154,10 +152,10 @@ jobs: push: true tags: | bpatrik/pigallery2:nightly-${{ matrix.container }} - bpatrik/pigallery2:${{ steps.vars.outputs.tag }}-${{ matrix.container }} + bpatrik/pigallery2:${{ github.ref_name }}-${{ matrix.container }} bpatrik/pigallery2:latest-${{ matrix.container }} - name: Push latest on new Tag - if: ${{ startsWith(steps.vars.outputs.type , 'tag') && !github.event.issue.pull_request && matrix.container == 'debian-bullseye'}} + if: ${{ startsWith(github.ref_type, 'tag') && !github.event.issue.pull_request && matrix.container == 'debian-bullseye'}} uses: docker/build-push-action@v3 with: context: . @@ -166,7 +164,7 @@ jobs: push: true tags: | bpatrik/pigallery2:nightly-${{ matrix.container }} - bpatrik/pigallery2:${{ steps.vars.outputs.tag }}-${{ matrix.container }} + bpatrik/pigallery2:${{ github.ref_name }}-${{ matrix.container }} bpatrik/pigallery2:latest-${{ matrix.container }} - bpatrik/pigallery2:${{ steps.vars.outputs.tag }} + bpatrik/pigallery2:${{ github.ref_name }} bpatrik/pigallery2:latest