From df860516a1be0db6c4d975ce6cd48804470d2bd5 Mon Sep 17 00:00:00 2001 From: Nicolas Duchon Date: Mon, 1 May 2023 22:04:17 +0200 Subject: [PATCH] build: requested changes --- .github/workflows/build-publish.yml | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-publish.yml index efa3392..2b4eb3e 100644 --- a/.github/workflows/build-publish.yml +++ b/.github/workflows/build-publish.yml @@ -28,8 +28,9 @@ jobs: with: fetch-depth: 0 - - name: Retrieve version - run: echo "GIT_DESCRIBE=$(git describe --tags)" >> $GITHUB_ENV + - name: Retrieve nginx-proxy version + id: nginx-proxy_version + run: echo "VERSION=$(git describe --tags)" >> "$GITHUB_OUTPUT" - name: Get Docker tags for Debian based image id: docker_meta_debian @@ -67,7 +68,8 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Retrieve docker-gen version - run: echo "DOCKER_GEN_VERSION=$(grep -o -E 'nginxproxy/docker-gen:([0-9x\.]+)' Dockerfile | cut -d ':' -f2)" >> $GITHUB_ENV + id: docker-gen_version + run: sed -n -e 's;^FROM nginxproxy/docker-gen:\([0-9.]*\).*;VERSION=\1;p' Dockerfile >> "$GITHUB_OUTPUT" - name: Build and push the Debian based image id: docker_build_debian @@ -76,8 +78,8 @@ jobs: context: . file: Dockerfile build-args: | - NGINX_PROXY_VERSION=${{ env.GIT_DESCRIBE }} - DOCKER_GEN_VERSION=${{ env.DOCKER_GEN_VERSION }} + NGINX_PROXY_VERSION=${{ steps.nginx-proxy_version.outputs.VERSION }} + DOCKER_GEN_VERSION=${{ steps.docker-gen_version.outputs.VERSION }} platforms: linux/amd64,linux/arm64,linux/arm/v7 push: true tags: ${{ steps.docker_meta_debian.outputs.tags }} @@ -95,8 +97,9 @@ jobs: with: fetch-depth: 0 - - name: Retrieve version - run: echo "GIT_DESCRIBE=$(git describe --tags)" >> $GITHUB_ENV + - name: Retrieve nginx-proxy version + id: nginx-proxy_version + run: echo "VERSION=$(git describe --tags)" >> "$GITHUB_OUTPUT" - name: Get Docker tags for Alpine based image id: docker_meta_alpine @@ -135,7 +138,8 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Retrieve docker-gen version - run: echo "DOCKER_GEN_VERSION=$(grep -o -E 'nginxproxy/docker-gen:([0-9x\.]+)' Dockerfile | cut -d ':' -f2)" >> $GITHUB_ENV + id: docker-gen_version + run: sed -n -e 's;^FROM nginxproxy/docker-gen:\([0-9.]*\).*;VERSION=\1;p' Dockerfile >> "$GITHUB_OUTPUT" - name: Build and push the Alpine based image id: docker_build_alpine @@ -144,8 +148,8 @@ jobs: context: . file: Dockerfile.alpine build-args: | - NGINX_PROXY_VERSION=${{ env.GIT_DESCRIBE }} - DOCKER_GEN_VERSION=${{ env.DOCKER_GEN_VERSION }} + NGINX_PROXY_VERSION=${{ steps.nginx-proxy_version.outputs.VERSION }} + DOCKER_GEN_VERSION=${{ steps.docker-gen_version.outputs.VERSION }} platforms: linux/amd64,linux/arm64,linux/arm/v7 push: true tags: ${{ steps.docker_meta_alpine.outputs.tags }}