-
Notifications
You must be signed in to change notification settings - Fork 1
281 lines (241 loc) · 7.53 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
name: Release
on:
release:
types: [released]
workflow_dispatch:
permissions:
contents: write
jobs:
docker-build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- name: astro-starter
target: scratch_astro_starter
out: astro-starter.tar.gz
- name: nextjs-starter
target: scratch_nextjs_starter
out: nextjs-starter.tar.gz
- name: nextjs-example
target: scratch_nextjs_example
out: nextjs-example.tar.gz
- name: react-starter
target: scratch_react_starter
out: react-starter.tar.gz
- name: react-example
target: scratch_react_example
out: react-example.tar.gz
- name: react-workshop
target: scratch_react_workshop
out: react-workshop.tar.gz
- name: vue-starter
target: scratch_vue_starter
out: vue-starter.tar.gz
- name: vue-example
target: scratch_vue_example
out: vue-example.tar.gz
- name: angular-starter
target: scratch_angular_starter
out: angular-starter.tar.gz
- name: angular-example
target: scratch_angular_example
out: angular-example.tar.gz
- name: sveltekit-starter
target: scratch_sveltekit_starter
out: sveltekit-starter.tar.gz
- name: sveltekit-example
target: scratch_sveltekit_example
out: sveltekit-example.tar.gz
- name: vanilla-js-example
target: scratch_vanilla_js_example
out: vanilla-js-example.tar.gz
steps:
- uses: actions/checkout@v4
- name: Set up docker buildx
uses: docker/setup-buildx-action@v3
- name: Prepare template ${{ matrix.name }}
uses: docker/build-push-action@v5
with:
file: Dockerfile
cache-from: type=gha,scope=cached-stage
# Exports the artefacts from the final stage
outputs: ./out
target: ${{ matrix.target }}
- run: sha256sum out/${{ matrix.out }}
- run: mv out/${{ matrix.out }} ${{ matrix.out }}
- name: 'Upload ${{ matrix.name }}'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.out }}
path: ./${{ matrix.out }}
release:
name: Release
runs-on: ubuntu-latest
needs: ['docker-build']
steps:
- uses: actions/checkout@v4
- name: Download astro-starter
uses: actions/download-artifact@v4
with:
name: astro-starter.tar.gz
path: .
- name: Download nextjs-starter
uses: actions/download-artifact@v4
with:
name: nextjs-starter.tar.gz
path: .
- name: Download nextjs-example
uses: actions/download-artifact@v4
with:
name: nextjs-example.tar.gz
path: .
- name: Download react-starter
uses: actions/download-artifact@v4
with:
name: react-starter.tar.gz
path: .
- name: Download react-example
uses: actions/download-artifact@v4
with:
name: react-example.tar.gz
path: .
- name: Download react-workshop
uses: actions/download-artifact@v4
with:
name: react-workshop.tar.gz
path: .
- name: Download vue-starter
uses: actions/download-artifact@v4
with:
name: vue-starter.tar.gz
path: .
- name: Download vue-example
uses: actions/download-artifact@v4
with:
name: vue-example.tar.gz
path: .
- name: Download angular-starter
uses: actions/download-artifact@v4
with:
name: angular-starter.tar.gz
path: .
- name: Download angular-example
uses: actions/download-artifact@v4
with:
name: angular-example.tar.gz
path: .
- name: Download sveltekit-starter
uses: actions/download-artifact@v4
with:
name: sveltekit-starter.tar.gz
path: .
- name: Download sveltekit-example
uses: actions/download-artifact@v4
with:
name: sveltekit-example.tar.gz
path: .
- name: Download vanilla-js-example
uses: actions/download-artifact@v4
with:
name: vanilla-js-example.tar.gz
path: .
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
./astro-starter.tar.gz
./nextjs-starter.tar.gz
./nextjs-example.tar.gz
./react-starter.tar.gz
./react-example.tar.gz
./react-workshop.tar.gz
./vue-starter.tar.gz
./vue-example.tar.gz
./angular-starter.tar.gz
./angular-example.tar.gz
./sveltekit-starter.tar.gz
./sveltekit-example.tar.gz
./vanilla-js-example.tar.gz
deploy:
name: Deploy to CDN
runs-on: ubuntu-latest
needs: ['docker-build']
steps:
- uses: actions/checkout@v4
- name: Download astro-starter
uses: actions/download-artifact@v4
with:
name: astro-starter.tar.gz
path: out/templates
- name: Download nextjs-starter
uses: actions/download-artifact@v4
with:
name: nextjs-starter.tar.gz
path: out/templates
- name: Download nextjs-example
uses: actions/download-artifact@v4
with:
name: nextjs-example.tar.gz
path: out/templates
- name: Download react-starter
uses: actions/download-artifact@v4
with:
name: react-starter.tar.gz
path: out/templates
- name: Download react-example
uses: actions/download-artifact@v4
with:
name: react-example.tar.gz
path: out/templates
- name: Download react-workshop
uses: actions/download-artifact@v4
with:
name: react-workshop.tar.gz
path: out/templates
- name: Download vue-starter
uses: actions/download-artifact@v4
with:
name: vue-starter.tar.gz
path: out/templates
- name: Download vue-example
uses: actions/download-artifact@v4
with:
name: vue-example.tar.gz
path: out/templates
- name: Download angular-starter
uses: actions/download-artifact@v4
with:
name: angular-starter.tar.gz
path: out/templates
- name: Download angular-example
uses: actions/download-artifact@v4
with:
name: angular-example.tar.gz
path: out/templates
- name: Download sveltekit-starter
uses: actions/download-artifact@v4
with:
name: sveltekit-starter.tar.gz
path: out/templates
- name: Download sveltekit-example
uses: actions/download-artifact@v4
with:
name: sveltekit-example.tar.gz
path: out/templates
- name: Download vanilla-js-example
uses: actions/download-artifact@v4
with:
name: vanilla-js-example.tar.gz
path: out/templates
- uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- name: Deploy to Juno
uses: junobuild/juno-action@main
with:
args: deploy
env:
JUNO_TOKEN: ${{ secrets.JUNO_TOKEN }}