|
21 | 21 | steps:
|
22 | 22 | - name: Checkout
|
23 | 23 | uses: actions/checkout@v2
|
24 |
| - |
25 |
| - - name: Docker meta for TAG |
26 |
| - id: meta |
27 |
| - uses: docker/metadata-action@v3 |
28 |
| - if: ${{ github.event.action != 'refresh' }} |
29 | 24 | with:
|
30 |
| - images: ${{ secrets.DOCKER_IMAGE }} |
31 |
| - tags: | |
32 |
| - type=match,pattern=v(.*),group=1, enable=true,priority=600,prefix=${{matrix.python_version}}-v,suffix=,value= |
| 25 | + fetch-depth: 0 |
33 | 26 |
|
34 |
| - - name: Docker meta for TAG (refresh image) |
| 27 | + - name: Collect latest git TAG for refresh |
| 28 | + id: get_latest_tag |
| 29 | + run: | |
| 30 | + echo "LATEST_TAG= 0" >> $GITHUB_ENV |
| 31 | + echo "LATEST_TAG= $(git describe --tags --abbrev=0)" >> $GITHUB_ENV |
| 32 | + echo "Latest tag is set to ${{env.LATEST_TAG}}" |
| 33 | +
|
| 34 | + - name: Docker meta for TAG |
35 | 35 | id: meta
|
36 | 36 | uses: docker/metadata-action@v3
|
37 |
| - if: ${{ github.event.action == 'refresh' }} |
38 |
| - env: |
39 |
| - LATEST_TAG: $(git describe --tags --abbrev=0) |
40 | 37 | with:
|
41 | 38 | images: ${{ secrets.DOCKER_IMAGE }}
|
42 | 39 | tags: |
|
43 |
| - raw=enable=true,priority=600,prefix=${{matrix.python_version}}-v,suffix=,value=${LATEST_TAG} |
| 40 | + type=match,pattern=v(.*),group=1, enable=true,priority=200,prefix=${{matrix.python_version}}-v,suffix=,value= |
| 41 | + raw=enable=true,priority=600,prefix=${{matrix.python_version}}-v,suffix=,value=${{env.LATEST_TAG}} |
44 | 42 |
|
45 | 43 | - name: Login to DockerHub
|
46 | 44 | uses: docker/login-action@v1
|
|
0 commit comments