1
0
forked from lxh/go-wxhelper

💚 优化Actions工作流配置

This commit is contained in:
李寻欢 2023-10-25 09:53:25 +08:00
parent 745dabbffd
commit 301e75cf0c

View File

@ -26,23 +26,29 @@ jobs:
- name: Gen Tags - name: Gen Tags
id: gen_tags id: gen_tags
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: gitee.ltd/lxh/go-wxhelper
tags: |
type=ref,event=branch
type=ref,event=tag
type=sha
- name: Print Tags
run: | run: |
if [[ $GITHUB_REF == 'refs/tags/'* ]]; then echo ${{ steps.gen_tags.outputs.tags }}
TAGS='["gitee.ltd/lxh/go-wxhelper:latest","gitee.ltd/lxh/go-wxhelper:'${GITHUB_REF/refs\/tags\//}'"]' echo "----------------- labels -----------------"
else echo ${{ steps.meta.outputs.labels }}
TAGS='["gitee.ltd/lxh/go-wxhelper:latest"]'
fi
echo '::set-output name=tags::'$TAGS
- name: Login to Repository # - name: Login to Repository
uses: docker/login-action@v2 # uses: docker/login-action@v2
with: # with:
registry: gitee.ltd # registry: gitee.ltd
username: ${{ secrets.USERNAME }} # username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }} # password: ${{ secrets.PASSWORD }}
- name: Build image # - name: Build image
uses: docker/build-push-action@v2 # uses: docker/build-push-action@v2
with: # with:
push: true # push: true
tags: ${{ fromJson(steps.gen_tags.outputs.tags) }} # tags: ${{ fromJson(steps.gen_tags.outputs.tags) }}