diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f4796c7e4..2d848cba1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -54,13 +54,17 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Get git tag + run: | + echo "::set-output name=GIT_TAG::$(git describe --tags $(git rev-list --tags --max-count=1))" + id: extract_variables - name: Build and push uses: docker/build-push-action@v2 with: context: . file: ./Dockerfile push: true - tags: ${{ github.repository }}:latest + tags: ${{ github.repository }}:${{ steps.extract_variables.outputs.GIT_TAG }} cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache