File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change 1- name : Push OpenSIPS Python Images in Docker Hub
1+ name : Push OpenSIPS Python Images to Docker Hub
22
33on :
44 push :
77jobs :
88 build :
99 runs-on : ubuntu-latest
10- if : startsWith(github.ref, 'refs/tags/') # only publish to Docker Hub on tag pushes
10+ if : startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
1111
1212 steps :
1313 - uses : actions/checkout@v3
@@ -18,11 +18,22 @@ jobs:
1818 username : ${{ secrets.DOCKER_USERNAME }}
1919 password : ${{ secrets.DOCKER_TOKEN }}
2020
21+ - name : Get latest tag if manually triggered
22+ id : get_tag
23+ run : |
24+ if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
25+ git fetch --tags
26+ LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
27+ echo "tag=$LATEST_TAG" >> $GITHUB_ENV
28+ else
29+ echo "tag=${{ github.ref_name }}" >> $GITHUB_ENV
30+ fi
31+
2132 - name : Build and push Docker image
2233 uses : docker/build-push-action@v4
2334 with :
2435 context : .
2536 push : true
2637 tags : |
2738 opensips/python-opensips:latest
28- opensips/python-opensips:${{ github.ref_name }}
39+ opensips/python-opensips:${{ env.tag }}
You can’t perform that action at this time.
0 commit comments