@@ -78,11 +78,28 @@ jobs:
78
78
registry : ${{ env.REGISTRY }}
79
79
username : ${{ github.actor }}
80
80
password : ${{ secrets.GH_PUBLISH_SECRETS }}
81
+ - name : Log into registry ${{ env.REGISTRY_DOCKERHUB }}
82
+ if : github.event_name != 'pull_request'
83
+ uses : docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
84
+ with :
85
+ registry : ${{ env.REGISTRY_DOCKERHUB }}
86
+ username : linuxsuren
87
+ password : ${{ secrets.DOCKER_HUB_PUBLISH_SECRETS }}
88
+ - name : Log into registry ${{ env.REGISTRY_ALIYUN }}
89
+ if : github.event_name != 'pull_request'
90
+ uses : docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
91
+ with :
92
+ registry : ${{ env.REGISTRY_ALIYUN }}
93
+ username : ${{ secrets.REGISTRY_ALIYUN_USER }}
94
+ password : ${{ secrets.REGISTRY_ALIYUN_PUBLISH_SECRETS }}
81
95
- name : Extract Docker metadata
82
96
id : meta
83
97
uses : docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
84
98
with :
85
- images : ${{ env.REGISTRY }}/linuxsuren/api-testing
99
+ images : |
100
+ ${{ env.REGISTRY }}/linuxsuren/api-testing
101
+ ${{ env.REGISTRY_DOCKERHUB }}/${{ env.IMAGE_NAME }}
102
+ ${{ env.REGISTRY_ALIYUN }}/${{ env.IMAGE_NAME }}
86
103
- name : Build and push Docker image
87
104
id : build-and-push
88
105
uses : docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a
@@ -91,10 +108,21 @@ jobs:
91
108
push : ${{ github.event_name != 'pull_request' }}
92
109
tags : ${{ steps.meta.outputs.tags }}
93
110
labels : ${{ steps.meta.outputs.labels }}
94
- platforms : linux/amd64,linux/arm64
111
+ platforms : linux/amd64,linux/arm64,darwin/amd64
95
112
cache-from : type=gha
96
113
cache-to : type=gha,mode=max
97
114
build-args : VERSION=${{ steps.vars.outputs.tag }}
115
+ - name : Release Helm
116
+ run : |
117
+ echo ${{ secrets.DOCKER_HUB_PUBLISH_SECRETS }} | helm registry login docker.io -u linuxsuren --password-stdin
118
+ export APP_VERSION=${{ steps.vars.outputs.tag }}
119
+ export HELM_VERSION=${{ steps.vars.outputs.tag }}
120
+ if [[ ! "$line" =~ ^v ]]
121
+ then
122
+ unset APP_VERSION
123
+ unset HELM_VERSION
124
+ fi
125
+ make helm-package helm-push
98
126
99
127
# image-operator:
100
128
# runs-on: ubuntu-20.04
@@ -126,90 +154,3 @@ jobs:
126
154
# platforms: linux/amd64,linux/arm64
127
155
# cache-from: type=gha
128
156
# cache-to: type=gha,mode=max
129
-
130
- image-dockerhub :
131
- runs-on : ubuntu-20.04
132
- steps :
133
- - name : Checkout
134
- uses : actions/checkout@v4
135
- with :
136
- fetch-tags : true
137
- fetch-depth : 0
138
- - name : Set output
139
- id : vars
140
- run : echo "tag=$(git describe --tags)" >> $GITHUB_OUTPUT
141
- - name : Setup Docker buildx
142
- uses : docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf
143
- - name : Log into registry ${{ env.REGISTRY_DOCKERHUB }}
144
- if : github.event_name != 'pull_request'
145
- uses : docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
146
- with :
147
- registry : ${{ env.REGISTRY_DOCKERHUB }}
148
- username : linuxsuren
149
- password : ${{ secrets.DOCKER_HUB_PUBLISH_SECRETS }}
150
- - name : Extract Docker metadata
151
- id : meta
152
- uses : docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
153
- with :
154
- images : ${{ env.REGISTRY_DOCKERHUB }}/${{ env.IMAGE_NAME }}
155
- - name : Build and push Docker image
156
- id : build-and-push
157
- uses : docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a
158
- with :
159
- context : .
160
- push : ${{ github.event_name != 'pull_request' }}
161
- tags : ${{ steps.meta.outputs.tags }}
162
- labels : ${{ steps.meta.outputs.labels }}
163
- platforms : linux/amd64,linux/arm64
164
- cache-from : type=gha
165
- cache-to : type=gha,mode=max
166
- build-args : VERSION=${{ steps.vars.outputs.tag }}
167
- - name : Release Helm
168
- run : |
169
- echo ${{ secrets.DOCKER_HUB_PUBLISH_SECRETS }} | helm registry login docker.io -u linuxsuren --password-stdin
170
- export APP_VERSION=${{ steps.vars.outputs.tag }}
171
- export HELM_VERSION=${{ steps.vars.outputs.tag }}
172
- if [[ ! "$line" =~ ^v ]]
173
- then
174
- unset APP_VERSION
175
- unset HELM_VERSION
176
- fi
177
- make helm-package helm-push
178
-
179
- image-aliyuncs :
180
- runs-on : ubuntu-20.04
181
- steps :
182
- - name : Checkout
183
- uses : actions/checkout@v4
184
- with :
185
- fetch-tags : true
186
- fetch-depth : 0
187
- - name : Set output
188
- id : vars
189
- run : echo "tag=$(git describe --tags)" >> $GITHUB_OUTPUT
190
- - name : Setup Docker buildx
191
- uses : docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf
192
- - name : Log into registry ${{ env.REGISTRY_ALIYUN }}
193
- if : github.event_name != 'pull_request'
194
- uses : docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
195
- with :
196
- registry : ${{ env.REGISTRY_ALIYUN }}
197
- username : ${{ secrets.REGISTRY_ALIYUN_USER }}
198
- password : ${{ secrets.REGISTRY_ALIYUN_PUBLISH_SECRETS }}
199
- - name : Extract Docker metadata
200
- id : meta
201
- uses : docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
202
- with :
203
- images : ${{ env.REGISTRY_ALIYUN }}/${{ env.IMAGE_NAME }}
204
- - name : Build and push Docker image
205
- id : build-and-push
206
- uses : docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a
207
- with :
208
- context : .
209
- push : ${{ github.event_name != 'pull_request' }}
210
- tags : ${{ steps.meta.outputs.tags }}
211
- labels : ${{ steps.meta.outputs.labels }}
212
- platforms : linux/amd64,linux/arm64
213
- cache-from : type=gha
214
- cache-to : type=gha,mode=max
215
- build-args : VERSION=${{ steps.vars.outputs.tag }}
0 commit comments