21
21
deploy :
22
22
if : github.repository_owner == 'appthreat'
23
23
runs-on : ubuntu-24.04
24
+ outputs :
25
+ image-uri : ghcr.io/appthreat/chen@${{ steps.build.outputs.digest }}
24
26
permissions :
25
27
contents : write
26
28
packages : write
96
98
chmod +x nydus-static/*
97
99
mv nydus-static/* /usr/local/bin/
98
100
rm -rf nydus-static-v2.3.1-linux-amd64.tgz nydus-static
99
- - run : docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
101
+ - name : Set up QEMU
102
+ uses : docker/setup-qemu-action@v3
100
103
- name : Set up Docker Buildx
101
104
uses : docker/setup-buildx-action@v3
102
105
- name : Log in to the Container registry
@@ -111,12 +114,13 @@ jobs:
111
114
with :
112
115
images : |
113
116
ghcr.io/appthreat/chen
117
+ flavor : latest=false,suffix=-amd64
114
118
- name : Build and push Docker images
115
119
uses : docker/build-push-action@v5
116
120
with :
117
121
file : ci/Dockerfile
118
122
context : .
119
- platforms : linux/amd64,linux/arm64
123
+ platforms : linux/amd64
120
124
push : true
121
125
tags : ${{ steps.meta.outputs.tags }}
122
126
labels : ${{ steps.meta.outputs.labels }}
@@ -126,3 +130,114 @@ jobs:
126
130
nydusify check --target ${{ steps.meta.outputs.tags }}-nydus
127
131
if : github.ref == 'refs/heads/main'
128
132
continue-on-error : true
133
+
134
+ deploy-arm :
135
+ if : github.repository_owner == 'appthreat'
136
+ runs-on : ubuntu-24.04-arm
137
+ outputs :
138
+ image-uri : ghcr.io/appthreat/chen@${{ steps.build.outputs.digest }}
139
+ permissions :
140
+ contents : write
141
+ packages : write
142
+ steps :
143
+ - uses : actions/checkout@v4
144
+ with :
145
+ fetch-depth : 0
146
+ - name : Set up JDK
147
+ uses : actions/setup-java@v4
148
+ with :
149
+ distribution : ' temurin'
150
+ java-version : ' 21'
151
+ - uses : sbt/setup-sbt@v1
152
+ - name : " Install PHP"
153
+ uses : " shivammathur/setup-php@v2"
154
+ with :
155
+ coverage : " none"
156
+ php-version : " 8.3"
157
+ tools : composer:v2
158
+ - name : Set up Python
159
+ uses : actions/setup-python@v5
160
+ with :
161
+ python-version : ' 3.12'
162
+ - name : Use Node.js
163
+ uses : actions/setup-node@v4
164
+ with :
165
+ node-version : ' 23.x'
166
+ - name : Trim CI agent
167
+ run : |
168
+ chmod +x ci/free_disk_space.sh
169
+ ./ci/free_disk_space.sh
170
+ - name : Delete `.rustup` directory
171
+ run : rm -rf /home/runner/.rustup # to save disk space
172
+ if : runner.os == 'Linux'
173
+ - name : Delete `.cargo` directory # to save disk space
174
+ run : rm -rf /home/runner/.cargo
175
+ if : runner.os == 'Linux'
176
+ - uses : actions/cache@v4
177
+ with :
178
+ path : |
179
+ ~/.sbt
180
+ ~/.coursier
181
+ key : ${{ runner.os }}-sbt-${{ hashfiles('**/build.sbt') }}
182
+ - run : |
183
+ sbt stage createDistribution
184
+ env:
185
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
186
+ SCALAPY_PYTHON_LIBRARY: "python3.12"
187
+ - name : Set up QEMU
188
+ uses : docker/setup-qemu-action@v3
189
+ - name : Set up Docker Buildx
190
+ uses : docker/setup-buildx-action@v3
191
+ - name : Log in to the Container registry
192
+ uses : docker/login-action@v3
193
+ with :
194
+ registry : ghcr.io
195
+ username : ${{ github.actor }}
196
+ password : ${{ secrets.GITHUB_TOKEN }}
197
+ - name : Extract metadata (tags, labels) for Docker
198
+ id : meta
199
+ uses : docker/metadata-action@v5
200
+ with :
201
+ images : |
202
+ ghcr.io/appthreat/chen
203
+ flavor : latest=false,suffix=-arm64
204
+ - name : Build and push Docker images
205
+ uses : docker/build-push-action@v5
206
+ with :
207
+ file : ci/Dockerfile
208
+ context : .
209
+ platforms : linux/arm64
210
+ push : true
211
+ tags : ${{ steps.meta.outputs.tags }}
212
+ labels : ${{ steps.meta.outputs.labels }}
213
+
214
+ deploy-manifest :
215
+ if : github.repository_owner == 'appthreat'
216
+ runs-on : ubuntu-24.04
217
+ needs : [deploy, deploy-arm]
218
+ outputs :
219
+ image-uri : ghcr.io/appthreat/chen@${{ steps.build.outputs.digest }}
220
+ permissions :
221
+ contents : write
222
+ packages : write
223
+ steps :
224
+ - uses : actions/checkout@v4
225
+ with :
226
+ fetch-depth : 0
227
+ - uses : docker/login-action@v3
228
+ with :
229
+ registry : ghcr.io
230
+ username : ${{ github.actor }}
231
+ password : ${{ secrets.GITHUB_TOKEN }}
232
+ - uses : docker/metadata-action@v5
233
+ id : metadata
234
+ with :
235
+ images : ghcr.io/${{ github.repository }}
236
+ - uses : int128/docker-manifest-create-action@v2
237
+ id : build
238
+ with :
239
+ index-annotations : ${{ steps.metadata.outputs.labels }}
240
+ tags : ${{ steps.metadata.outputs.tags }}
241
+ sources : |
242
+ ${{ needs.deploy.outputs.image-uri }}
243
+ ${{ needs.deploy-arm.outputs.image-uri }}
0 commit comments