File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change 11name : Build & Push Docker Images on Tag
2+
23on :
34 push :
45 tags :
5- - ' v*' # Triggers only on tags like v0.1.2, v0.1.2.dev1, etc.
6+ - ' v*' # Triggers on tags like v0.1.2, v0.1.2.dev1, etc.
67 workflow_dispatch :
78
89jobs :
2122 echo "VERSION=${TAG_NAME}" >> $GITHUB_ENV
2223 echo "version=${TAG_NAME}" >> $GITHUB_OUTPUT
2324
25+ - name : Determine if version is pure semver (e.g. v0.1.2)
26+ id : semver_check
27+ run : |
28+ if echo "${{ steps.vars.outputs.version }}" | grep -Eq '^v[0-9]+\.[0-9]+\.[0-9]+$'; then
29+ echo "is_release=true" >> $GITHUB_OUTPUT
30+ else
31+ echo "is_release=false" >> $GITHUB_OUTPUT
32+ fi
33+
2434 - name : Log in to Docker Hub
2535 uses : docker/login-action@v3
2636 with :
@@ -47,10 +57,10 @@ jobs:
4757 docker push $IMAGE_BASE:torch-${VERSION}
4858 docker push $IMAGE_BASE:tensorflow-${VERSION}
4959
50- - name : Tag and push latest if version is pure semver
51- if : ${{ steps.vars .outputs.version =~ '^v[0-9]+\\.[0-9]+\\.[0-9]+$ ' }}
60+ - name : Tag and push latest if release version
61+ if : ${{ steps.semver_check .outputs.is_release == 'true ' }}
5262 run : |
53- echo "Tag is a pure semver release — tagging latest"
63+ echo "Tag is a release — tagging latest"
5464
5565 docker tag $IMAGE_BASE:base-${VERSION} $IMAGE_BASE:base-latest
5666 docker tag $IMAGE_BASE:torch-${VERSION} $IMAGE_BASE:torch-latest
You can’t perform that action at this time.
0 commit comments