99jobs :
1010 release :
1111 permissions :
12- # to create release tags (cycjimmy/semantic-release-action)
12+ # to create release tags (cycjimmy/semantic-release-action)
1313 contents : write
1414 issues : write
1515 pull-requests : write
16-
1716 runs-on : ubuntu-latest
1817 outputs :
1918 published : ${{ steps.semantic.outputs.new_release_published }}
2019 version : ${{ steps.semantic.outputs.new_release_version }}
2120 steps :
2221 - uses : actions/checkout@v3
22+ if : github.event_name == 'push'
2323
2424 - name : Semantic Release
25+ if : github.event_name == 'push'
2526 id : semantic
2627 uses : cycjimmy/semantic-release-action@v4
2728 with :
@@ -31,32 +32,76 @@ jobs:
3132 env :
3233 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
3334
34- publish_image :
35+ publish_operator_image :
3536 needs :
3637 - release
37- if : needs.release.outputs.published == 'true'
38+ if : needs.release.outputs.published == 'true' || github.event_name == 'workflow_dispatch'
3839 runs-on : ubuntu-latest
3940 outputs :
4041 image_digest : ${{ steps.build.outputs.digest }}
4142 steps :
4243 - uses : actions/checkout@v3
44+
45+ - name : Set Tag
46+ if : github.event_name == 'workflow_dispatch'
47+ id : set_tag
48+ run : echo "tag=dev-$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
49+
4350 - id : meta
4451 uses : docker/metadata-action@v4
4552 with :
4653 images : tensorfusion/tensor-fusion-operator
47- tags : type=semver,pattern={{version}},value=${{needs.release.outputs.version}}
54+ tags : ${{ github.event_name == 'workflow_dispatch' && steps.set_tag.outputs.tag || 'type=semver,pattern={{version}},value=${{needs.release.outputs.version}}' }}
55+
56+ - name : Login to DockerHub
57+ uses : docker/login-action@v2
58+ with :
59+ username : ${{ secrets.DOCKER_USERNAME }}
60+ password : ${{ secrets.DOCKER_PASSWORD }}
61+
62+ - name : Build and push operator
63+ uses : docker/build-push-action@v3
64+ with :
65+ context : .
66+ push : true
67+ file : dockerfile/operator.Dockerfile
68+ tags : ${{ steps.meta.outputs.tags }}
69+ labels : ${{ steps.meta.outputs.labels }}
70+ no-cache : true
71+
72+ publish_node_discovery_image :
73+ needs :
74+ - release
75+ if : needs.release.outputs.published == 'true' || github.event_name == 'workflow_dispatch'
76+ runs-on : ubuntu-latest
77+ outputs :
78+ image_digest : ${{ steps.build.outputs.digest }}
79+ steps :
80+ - uses : actions/checkout@v3
81+
82+ - name : Set Tag
83+ if : github.event_name == 'workflow_dispatch'
84+ id : set_tag
85+ run : echo "tag=dev-$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
86+
87+ - id : meta
88+ uses : docker/metadata-action@v4
89+ with :
90+ images : tensorfusion/tensor-fusion-node-discovery
91+ tags : ${{ github.event_name == 'workflow_dispatch' && steps.set_tag.outputs.tag || 'type=semver,pattern={{version}},value=${{needs.release.outputs.version}}' }}
4892
4993 - name : Login to DockerHub
5094 uses : docker/login-action@v2
5195 with :
5296 username : ${{ secrets.DOCKER_USERNAME }}
5397 password : ${{ secrets.DOCKER_PASSWORD }}
5498
55- - name : Build and push
99+ - name : Build and push node discovery
56100 uses : docker/build-push-action@v3
57101 with :
58102 context : .
59103 push : true
104+ file : dockerfile/node-disvoery.Dockerfile
60105 tags : ${{ steps.meta.outputs.tags }}
61106 labels : ${{ steps.meta.outputs.labels }}
62107 no-cache : true
0 commit comments