diff --git a/.gitea/workflows/build-image.yaml b/.gitea/workflows/build-image.yaml index d616e2b..20cb2bf 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) }}