From 8508b9a41c7f87c5aa61051c42b7debe12f97b40 Mon Sep 17 00:00:00 2001 From: "Patrik J. Braun" Date: Thu, 3 Aug 2023 09:20:29 +0200 Subject: [PATCH] Update build.yml Fixing build file vars. Following: https://docs.github.com/en/actions/learn-github-actions/contexts --- .github/workflows/build.yml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) 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