File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change 55 types : [released, prereleased]
66
77jobs :
8+ fetch-latest-tag :
9+ runs-on : ubuntu-latest
10+ outputs :
11+ latest_tag : ${{ steps.get_latest_tag.outputs.latest_tag }}
12+ steps :
13+ - name : Checkout code
14+ uses : actions/checkout@v3
15+ with :
16+ fetch-depth : 0
17+
18+ - name : Fetch all tags
19+ run : git fetch --tags
20+
21+ - name : Get the latest tag
22+ id : get_latest_tag
23+ run : |
24+ latest_tag=$(git tag -l | sort -V | tail -n 1)
25+ echo "::set-output name=latest_tag::${latest_tag}"
26+
827 docker :
928 runs-on : ubuntu-latest
29+ needs : fetch-latest-tag
1030 permissions :
1131 contents : read
1232 packages : write
3050 password : ${{ secrets.GITHUB_TOKEN }}
3151
3252 - name : Set latest tag
33- if : github.event.action == 'released'
53+ if : github.event.action == 'released' && github.ref_name == needs.fetch-latest-tag.outputs.latest_tag
3454 run : |
3555 echo "DOCKER_TAGS=${{ env.DOCKER_TAGS }},ghcr.io/${{ github.repository }}:latest" >> $GITHUB_ENV
3656
You can’t perform that action at this time.
0 commit comments