From 6fdeafbc0c4134aab54cd9531144890e0a2cdeb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=AF=BB=E6=AC=A2?= Date: Wed, 25 Oct 2023 09:39:33 +0800 Subject: [PATCH] =?UTF-8?q?:green=5Fheart:=20=E4=BC=98=E5=8C=96Actions?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E6=B5=81=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/build-image.yaml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/build-image.yaml b/.gitea/workflows/build-image.yaml index d616e2b6..20cb2bff 100644 --- a/.gitea/workflows/build-image.yaml +++ b/.gitea/workflows/build-image.yaml @@ -24,6 +24,14 @@ jobs: - name: Checkout Code uses: actions/checkout@v3 + - name: Gen Tags + id: gen_tags + run: | + if [[ $GITHUB_REF == 'refs/tags/'* ]]; then + TAGS='["gitee.ltd/lxh/go-wxhelper:latest","gitee.ltd/lxh/go-wxhelper:'${GITHUB_REF/refs\/tags\//}'"]' + else + TAGS='["gitee.ltd/lxh/go-wxhelper:latest"]' + - name: Login to Repository uses: docker/login-action@v2 with: @@ -35,6 +43,4 @@ jobs: uses: docker/build-push-action@v2 with: push: true - tags: | - gitee.ltd/lxh/go-wxhelper:latest - gitee.ltd/lxh/go-wxhelper:v${{ github.run_number }} + tags: ${{ fromJson(steps.gen_tags.outputs.tags) }}