From defa5646014665081af81f2fae0ac0ad3b215cf2 Mon Sep 17 00:00:00 2001 From: Joao M Date: Sat, 20 Aug 2022 16:10:23 +0000 Subject: [PATCH] Try add release tags --- .github/workflows/build.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e18c8a0..1a84174 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,6 +62,23 @@ jobs: with: images: ${{ secrets.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }} + - uses: actions/github-script@v6 + id: tags + with: + script: | + tags = "${{ join(steps.meta.outputs.tags, ',') }}" + result = [] + tags.split(",").forEach(function (item) { + short_tag = item.trim().split(":")[1]; + if (short_tag != "latest") { + result.push(short_tag); + } + }) + return result.join(","); + result-encoding: string + - name: Get result + run: echo "${{steps.set-result.outputs.result}}" + # Build and push Docker image with Buildx (don't push on PR) # https://github.com/docker/build-push-action - name: Build and push Docker image @@ -70,7 +87,7 @@ jobs: context: . file: Dockerfile build-args: | - RELEASE_VERSION_ARG="${{ join(steps.meta.outputs.tags, ',') }} - ${{ env.GITHUB_SHA }}" + RELEASE_VERSION_ARG="${{ join(steps.tags.outputs.result, ',') }}" platforms: linux/amd64,linux/arm64 push: ${{ github.event_name != 'pull_request' || github.event.inputs.push == 'true' }} tags: ${{ steps.meta.outputs.tags }}