💚 优化Actions工作流配置

This commit is contained in:
李寻欢 2023-10-25 09:39:33 +08:00
parent 9f0626f1ec
commit 6fdeafbc0c

View File

@ -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) }}