Skip to content

Commit b974560

Browse files
committed
fix: update release workflow to handle workflow_dispatch event
1 parent 95b30d6 commit b974560

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

.github/workflows/release.yml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ on:
88

99
jobs:
1010
release:
11+
if: github.event_name == 'push'
1112
permissions:
12-
# to create release tags (cycjimmy/semantic-release-action)
13+
# to create release tags (cycjimmy/semantic-release-action)
1314
contents: write
1415
issues: write
1516
pull-requests: write
16-
1717
runs-on: ubuntu-latest
1818
outputs:
1919
published: ${{ steps.semantic.outputs.new_release_published }}
@@ -32,50 +32,56 @@ jobs:
3232
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3333

3434
publish_image:
35-
needs:
35+
needs:
3636
- release
37-
if: needs.release.outputs.published == 'true'
37+
if: needs.release.outputs.published == 'true' || github.event_name == 'workflow_dispatch'
3838
runs-on: ubuntu-latest
3939
outputs:
4040
image_digest: ${{ steps.build.outputs.digest }}
4141
steps:
4242
- uses: actions/checkout@v3
43+
44+
- name: Set Tag
45+
if: github.event_name == 'workflow_dispatch'
46+
id: set_tag
47+
run: echo "::set-output name=tag::$(git rev-parse --short HEAD)"
48+
4349
- id: meta_operator
4450
uses: docker/metadata-action@v4
4551
with:
4652
images: tensorfusion/tensor-fusion-operator
47-
tags: type=semver,pattern={{version}},value=${{needs.release.outputs.version}}
53+
tags: ${{ github.event_name == 'workflow_dispatch' && steps.set_tag.outputs.tag || 'type=semver,pattern={{version}},value=${{needs.release.outputs.version}}' }}
4854

4955
- id: meta_node_discovery
5056
uses: docker/metadata-action@v4
5157
with:
5258
images: tensorfusion/tensor-fusion-node-discovery
53-
tags: type=semver,pattern={{version}},value=${{needs.release.outputs.version}}
59+
tags: ${{ github.event_name == 'workflow_dispatch' && steps.set_tag.outputs.tag || 'type=semver,pattern={{version}},value=${{needs.release.outputs.version}}' }}
5460

5561
- name: Login to DockerHub
5662
uses: docker/login-action@v2
5763
with:
5864
username: ${{ secrets.DOCKER_USERNAME }}
5965
password: ${{ secrets.DOCKER_PASSWORD }}
6066

61-
- name: Build and push
67+
- name: Build and push operator
6268
uses: docker/build-push-action@v3
6369
with:
6470
context: .
6571
push: true
6672
build-args: |
67-
CMD=operaotr
73+
CMD=operator
6874
tags: ${{ steps.meta_operator.outputs.tags }}
6975
labels: ${{ steps.meta_operator.outputs.labels }}
7076
no-cache: true
7177

72-
- name: Build and push
78+
- name: Build and push node discovery
7379
uses: docker/build-push-action@v3
7480
with:
7581
context: .
7682
push: true
7783
build-args: |
78-
CMD=operaotr
84+
CMD=operator
7985
tags: ${{ steps.meta_node_discovery.outputs.tags }}
8086
labels: ${{ steps.meta_node_discovery.outputs.labels }}
8187
no-cache: true

0 commit comments

Comments
 (0)