Skip to content

Commit bff0f2d

Browse files
committed
chore(CI): docker build
Signed-off-by: Bo-Yi.Wu <[email protected]>
1 parent b128f14 commit bff0f2d

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

.github/workflows/build.yaml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ jobs:
5454

5555
-
5656
name: Docker meta for linux amd64
57-
if: github.event_name == 'push'
5857
id: meta-linux-amd64
5958
uses: docker/metadata-action@v4
6059
with:
@@ -67,22 +66,23 @@ jobs:
6766
tags: |
6867
type=raw,value=
6968
type=raw,value=latest,suffix=
69+
type=semver,event=tag,pattern={{version}},suffix=-linux-amd64
70+
type=semver,event=tag,pattern={{major}}.{{minor}},suffix=-linux-amd64
71+
type=semver,event=tag,pattern={{major}},suffix=-linux-amd64
7072
7173
-
7274
name: Build and push linux amd64
73-
if: github.event_name == 'push'
7475
uses: docker/build-push-action@v3
7576
with:
7677
context: .
7778
file: docker/Dockerfile.linux.amd64
7879
platforms: linux/amd64
79-
push: ${{ github.event_name == 'push' }}
80+
push: true
8081
tags: ${{ steps.meta-linux-amd64.outputs.tags }}
8182
labels: ${{ steps.meta-linux-amd64.outputs.labels }}
8283

8384
-
8485
name: Docker meta for linux arm64
85-
if: github.event_name == 'push'
8686
id: meta-linux-arm64
8787
uses: docker/metadata-action@v4
8888
with:
@@ -94,22 +94,23 @@ jobs:
9494
ghcr.io/appleboy/gorush
9595
tags: |
9696
type=raw,value=
97+
type=semver,event=tag,pattern={{version}},suffix=-linux-arm64
98+
type=semver,event=tag,pattern={{major}}.{{minor}},suffix=-linux-arm64
99+
type=semver,event=tag,pattern={{major}},suffix=-linux-arm64
97100
98101
-
99102
name: Build and push linux arm64
100-
if: github.event_name == 'push'
101103
uses: docker/build-push-action@v3
102104
with:
103105
context: .
104106
file: docker/Dockerfile.linux.arm64
105107
platforms: linux/arm64
106-
push: ${{ github.event_name == 'push' }}
108+
push: true
107109
tags: ${{ steps.meta-linux-arm64.outputs.tags }}
108110
labels: ${{ steps.meta-linux-arm64.outputs.labels }}
109111

110112
-
111113
name: Docker meta for linux arm
112-
if: github.event_name == 'push'
113114
id: meta-linux-arm
114115
uses: docker/metadata-action@v4
115116
with:
@@ -121,15 +122,17 @@ jobs:
121122
ghcr.io/appleboy/gorush
122123
tags: |
123124
type=raw,value=
125+
type=semver,event=tag,pattern={{version}},suffix=-linux-arm
126+
type=semver,event=tag,pattern={{major}}.{{minor}},suffix=-linux-arm
127+
type=semver,event=tag,pattern={{major}},suffix=-linux-arm
124128
125129
-
126130
name: Build and push linux arm
127-
if: github.event_name == 'push'
128131
uses: docker/build-push-action@v3
129132
with:
130133
context: .
131134
file: docker/Dockerfile.linux.arm
132135
platforms: linux/arm
133-
push: ${{ github.event_name == 'push' }}
136+
push: true
134137
tags: ${{ steps.meta-linux-arm.outputs.tags }}
135138
labels: ${{ steps.meta-linux-arm.outputs.labels }}

0 commit comments

Comments
 (0)