diff --git a/.github/workflows/dockerhub-publish.yml b/.github/workflows/dockerhub-publish.yml index fca7f31af..07d7ea4f2 100644 --- a/.github/workflows/dockerhub-publish.yml +++ b/.github/workflows/dockerhub-publish.yml @@ -7,6 +7,9 @@ on: release: types: [published] +env: + IS_RELEASE: ${{github.event_name == 'release'}} + jobs: docker-publish: runs-on: ubuntu-latest @@ -25,11 +28,11 @@ jobs: # username: ${{ secrets.DOCKERHUB_USERNAME }} # password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Compute tags - # if: github.event_name == 'release' - run: echo "TAG_VERSION=$(release='${{github.event_name}}' && echo ${release:1})" >> $GITHUB_ENV + if: vars.IS_RELEASE + run: echo "TAG_VERSION=$(release='${{github.event.release.tag_name}}' && echo ${release:1})" >> $GITHUB_ENV - name: Print tags - run: echo ${{ (github.event_name == 'release' && format('gruxer/prism:{0},gruxer/prism:latest', github.event.release.tag_name)) || env.TAG_VERSION }} + run: echo ${{(vars.IS_RELEASE && format('gruxer/prism:{0},gruxer/prism:latest', env.TAG_VERSION)) || 'gruxer/prism:master' }} # - # name: Build and Push # uses: docker/build-push-action@v4