Skip to content

Commit dfe813d

Browse files
authored
Optimize docker build & push pipeline (#98)
1 parent c0f11a1 commit dfe813d

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

.github/workflows/docker.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ on:
44
push:
55
branches:
66
- main
7-
tags:
8-
- "v*"
7+
release:
8+
types:
9+
- created
910

1011
jobs:
1112
publish_to_docker_hub:
@@ -28,6 +29,7 @@ jobs:
2829
- name: Docker meta for Commit image
2930
id: meta_commit
3031
uses: docker/metadata-action@v3
32+
if: github.event_name == 'push'
3133
with:
3234
images: temporaliotest/ui
3335
tags: |
@@ -36,15 +38,17 @@ jobs:
3638
3739
- name: Push Commit image to DockerHub
3840
uses: docker/build-push-action@v2
41+
if: github.event_name == 'push'
3942
with:
40-
push: ${{ github.event_name == 'push' }}
43+
push: true
4144
platforms: linux/amd64,linux/arm64
4245
tags: ${{ steps.meta_commit.outputs.tags }}
4346
labels: ${{ steps.meta_commit.outputs.labels }}
4447

4548
- name: Docker meta for Release image
4649
id: meta_release
4750
uses: docker/metadata-action@v3
51+
if: github.event_name == 'release'
4852
with:
4953
images: temporalio/ui
5054
tags: |
@@ -53,8 +57,9 @@ jobs:
5357
5458
- name: Push Release image to DockerHub
5559
uses: docker/build-push-action@v2
60+
if: github.event_name == 'release'
5661
with:
57-
push: ${{ github.event_name == 'release' }}
62+
push: true
5863
platforms: linux/amd64,linux/arm64
5964
tags: ${{ steps.meta_release.outputs.tags }}
6065
labels: ${{ steps.meta_release.outputs.labels }}

0 commit comments

Comments
 (0)