3
3
workflow_dispatch : {}
4
4
push :
5
5
paths-ignore :
6
- - " helm/**"
7
6
- " *.md"
8
7
- " docs/**"
9
8
35
34
run : |
36
35
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
37
36
38
- - name : Login to Docker Hub
39
- uses : docker/login-action@v3
40
- if : ${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/tags/')) && github.event_name == 'push' }}
41
- with :
42
- username : ${{ secrets.DOCKERHUB_USERNAME }}
43
- password : ${{ secrets.DOCKERHUB_PASSWORD }}
44
-
45
37
- name : Set up Docker Buildx
46
38
uses : docker/setup-buildx-action@v3
47
39
55
47
cache-to : type=gha,mode=max
56
48
outputs : type=image,name=${{ env.REGISTRY_NODE_IMAGE }},push-by-digest=true,name-canonical=true,push=false
57
49
58
- - name : Push Docker image by digest
59
- if : ${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/tags/')) && github.event_name == 'push' }}
60
- uses : docker/build-push-action@v6
61
- with :
62
- context : .
63
- platforms : ${{ matrix.arch.platform }}
64
- cache-from : type=gha
65
- outputs : type=image,name=${{ env.REGISTRY_NODE_IMAGE }},push-by-digest=true,name-canonical=true,push=true
66
-
67
50
- name : Export digest
68
51
run : |
69
52
mkdir -p /tmp/digests
78
61
if-no-files-found : error
79
62
retention-days : 1
80
63
81
- merge-openmina-node-image :
82
- runs-on : ubuntu-latest
83
- if : ${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/tags/')) && github.event_name == 'push' }}
84
- needs :
85
- - build-openmina-node-image
86
- steps :
87
- - name : Download digests
88
- uses : actions/download-artifact@v4
89
- with :
90
- path : /tmp/digests
91
- pattern : node-digests-*
92
- merge-multiple : true
93
-
94
- - name : Set up Docker Buildx
95
- uses : docker/setup-buildx-action@v3
96
-
97
- - name : Docker meta
98
- id : meta
99
- uses : docker/metadata-action@v5
100
- with :
101
- images : ${{ env.REGISTRY_NODE_IMAGE }}
102
- # generate Docker tags based on the following events/attributes
103
- tags : |
104
- type=ref,event=branch
105
- type=sha,format=short
106
- type=semver,pattern={{version}},event=tag
107
- type=ref,event=tag
108
- type=raw,value=latest,enable=${{ github.ref_name == 'main' }}
109
-
110
- - name : Login to Docker Hub
111
- uses : docker/login-action@v3
112
- with :
113
- username : ${{ secrets.DOCKERHUB_USERNAME }}
114
- password : ${{ secrets.DOCKERHUB_PASSWORD }}
115
-
116
- - name : Create manifest list and push
117
- working-directory : /tmp/digests
118
- run : |
119
- docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
120
- $(printf '${{ env.REGISTRY_NODE_IMAGE }}@sha256:%s ' *)
121
-
122
- - name : Inspect image
123
- run : |
124
- docker buildx imagetools inspect ${{ env.REGISTRY_NODE_IMAGE }}:${{ steps.meta.outputs.version }}
125
-
126
64
# Frontend
127
-
128
65
build-openmina-frontend-image :
129
66
strategy :
130
67
matrix :
@@ -145,13 +82,6 @@ jobs:
145
82
- name : Git checkout
146
83
uses : actions/checkout@v4
147
84
148
- - name : Login to Docker Hub
149
- uses : docker/login-action@v3
150
- if : ${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/tags/')) && github.event_name == 'push' }}
151
- with :
152
- username : ${{ secrets.DOCKERHUB_USERNAME }}
153
- password : ${{ secrets.DOCKERHUB_PASSWORD }}
154
-
155
85
- name : Set up Docker Buildx
156
86
uses : docker/setup-buildx-action@v3
157
87
@@ -167,17 +97,6 @@ jobs:
167
97
cache-to : type=gha,mode=max
168
98
outputs : type=image,name=${{ env.REGISTRY_FRONTEND_IMAGE }},push-by-digest=true,name-canonical=true,push=false
169
99
170
- - name : Push Docker image by digest
171
- if : ${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/tags/')) && github.event_name == 'push' }}
172
- uses : docker/build-push-action@v6
173
- with :
174
- context : ./frontend
175
- platforms : ${{ matrix.arch.platform }}
176
- build-args : |
177
- BUILD_CONFIGURATION=${{ matrix.configuration.build_configuration }}
178
- cache-from : type=gha
179
- outputs : type=image,name=${{ env.REGISTRY_FRONTEND_IMAGE }},push-by-digest=true,name-canonical=true,push=true
180
-
181
100
- name : Export digest
182
101
run : |
183
102
mkdir -p /tmp/digests
@@ -191,52 +110,3 @@ jobs:
191
110
path : /tmp/digests/*
192
111
if-no-files-found : error
193
112
retention-days : 1
194
-
195
- merge-openmina-frontend-image :
196
- strategy :
197
- matrix :
198
- configuration :
199
- - build_configuration : production
200
- runs-on : ubuntu-latest
201
- if : ${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/tags/')) && github.event_name == 'push' }}
202
- needs :
203
- - build-openmina-frontend-image
204
- steps :
205
- - name : Download digests
206
- uses : actions/download-artifact@v4
207
- with :
208
- path : /tmp/digests
209
- pattern : frontend-${{ matrix.configuration.build_configuration }}-digests-*
210
- merge-multiple : true
211
-
212
- - name : Set up Docker Buildx
213
- uses : docker/setup-buildx-action@v3
214
-
215
- - name : Docker meta
216
- id : meta
217
- uses : docker/metadata-action@v5
218
- with :
219
- images : ${{ env.REGISTRY_FRONTEND_IMAGE }}
220
- tags : |
221
- type=ref,event=branch
222
- type=sha,format=short
223
- type=semver,pattern={{version}},event=tag
224
- type=ref,event=tag
225
- type=raw,value=latest,enable=${{ github.ref_name == 'main' }}
226
- type=raw,value=staging,enable=${{ github.ref_name == 'develop' }}
227
-
228
- - name : Login to Docker Hub
229
- uses : docker/login-action@v3
230
- with :
231
- username : ${{ secrets.DOCKERHUB_USERNAME }}
232
- password : ${{ secrets.DOCKERHUB_PASSWORD }}
233
-
234
- - name : Create manifest list and push
235
- working-directory : /tmp/digests
236
- run : |
237
- docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
238
- $(printf '${{ env.REGISTRY_FRONTEND_IMAGE }}@sha256:%s ' *)
239
-
240
- - name : Inspect image
241
- run : |
242
- docker buildx imagetools inspect ${{ env.REGISTRY_FRONTEND_IMAGE }}:${{ steps.meta.outputs.version }}
0 commit comments