From 8a26424de7df7c2c2aae886a7f4d5f935bdf9097 Mon Sep 17 00:00:00 2001 From: Dries Augustyns Date: Mon, 5 Aug 2024 09:44:36 +0200 Subject: [PATCH] Get version from package.json and use it as Docker tag --- .github/workflows/docker-build.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index cbd78eea..ea19f4e7 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -23,6 +23,10 @@ jobs: restore-keys: | ${{ runner.os }}-buildx- + - name: Get version from package.json + id: get_version + run: echo "VERSION=$(jq -r .version package.json)" >> $GITHUB_ENV + - name: Log in to Docker Hub uses: docker/login-action@v1 with: @@ -35,7 +39,7 @@ jobs: context: . file: ./Dockerfile push: true - tags: driaug/plunk:latest + tags: driaug/plunk:${{ env.VERSION }} platforms: linux/amd64,linux/arm64 cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max