6
6
push :
7
7
branches :
8
8
- master
9
- schedule :
10
- - cron : ' 0 5 * * *'
9
+
10
+ concurrency :
11
+ group : ${{ github.head_ref }}
12
+ cancel-in-progress : true
13
+
11
14
env :
12
15
DIRECT_DATABASE_URL : ${{secrets.DIRECT_DATABASE_URL}}
13
16
DATABASE_URL : ${{secrets.DATABASE_URL}}
18
21
ENVIRONMENT : ${{secrets.ENVIRONMENT}}
19
22
CLOUDFLARE_ACCOUNT_ID : ${{secrets.CLOUDFLARE_ACCOUNT_ID}}
20
23
CLOUDFLARE_API_TOKEN : ${{secrets.CLOUDFLARE_API_TOKEN}}
21
-
22
24
jobs :
23
25
INSTALL :
24
26
name : Install Dependencies
@@ -27,51 +29,260 @@ jobs:
27
29
- uses : actions/checkout@v4
28
30
- uses : pnpm/action-setup@v3
29
31
with :
30
- version : 9.1 .1
32
+ version : 9.12 .1
31
33
- uses : actions/setup-node@v3
32
34
with :
33
- node-version : ' 20 '
35
+ node-version : ' 22.9.0 '
34
36
- uses : actions/cache@v3
35
37
id : cache-pnpm
36
38
with :
37
39
path : ./node_modules
38
- key : ${{ runner.os }}-${{ hashFiles('./pnpm-lock.yaml', './prisma/dev.schema.prisma', './prisma/prod.schema.prisma ') }}
40
+ key : ${{ runner.os }}-${{ hashFiles('./pnpm-lock.yaml', '/.npmrc ') }}
39
41
- name : Install
40
42
if : steps.cache-pnpm.outputs.cache-hit != 'true'
41
43
run : |
42
44
pnpm i --frozen-lockfile
43
- pnpm prisma:gen:ci
44
- PUBLISH :
45
- name : Publish to Production
46
- environment : PRODUCTION
45
+ pnpm sync
46
+ LINT :
47
+ name : Lint
47
48
runs-on : ubuntu-latest
48
49
needs : INSTALL
49
50
steps :
50
51
- uses : actions/checkout@v4
51
52
- uses : pnpm/action-setup@v3
52
53
with :
53
- version : 9.1.1
54
+ version : 9.12.1
55
+ - uses : actions/setup-node@v3
56
+ with :
57
+ node-version : ' 22.9.0'
54
58
- uses : actions/cache@v3
55
59
with :
56
60
path : ./node_modules
57
- key : ${{ runner.os }}-${{ hashFiles('./pnpm-lock.yaml', './prisma/dev.schema.prisma', './prisma/prod.schema.prisma') }}
61
+ key : ${{ runner.os }}-${{ hashFiles('./pnpm-lock.yaml', '/.npmrc') }}
62
+ - name : Install Module Packages
63
+ run : |
64
+ pnpm i --frozen-lockfile
65
+ pnpm sync
66
+ - name : Lint
67
+ run : |
68
+ pnpm lint
69
+ VERIFY :
70
+ name : Verify
71
+ runs-on : ubuntu-latest
72
+ needs : INSTALL
73
+ steps :
74
+ - uses : actions/checkout@v4
75
+ - uses : pnpm/action-setup@v3
76
+ with :
77
+ version : 9.12.1
78
+ - uses : actions/setup-node@v3
79
+ with :
80
+ node-version : ' 22.9.0'
81
+ - uses : actions/cache@v3
82
+ with :
83
+ path : ./node_modules
84
+ key : ${{ runner.os }}-${{ hashFiles('./pnpm-lock.yaml', '/.npmrc') }}
85
+ - name : Install Module Packages
86
+ run : |
87
+ pnpm i --frozen-lockfile
88
+ pnpm sync
89
+ - name : Check
90
+ run : |
91
+ pnpm check
92
+ UNIT_TEST :
93
+ name : Unit Tests
94
+ runs-on : ubuntu-latest
95
+ needs : INSTALL
96
+ steps :
97
+ - uses : actions/checkout@v4
98
+ - uses : pnpm/action-setup@v3
99
+ with :
100
+ version : 9.12.1
101
+ - uses : actions/setup-node@v3
102
+ with :
103
+ node-version : ' 22.9.0'
104
+ - uses : actions/cache@v3
105
+ with :
106
+ path : ./node_modules
107
+ key : ${{ runner.os }}-${{ hashFiles('./pnpm-lock.yaml', '/.npmrc') }}
108
+ - name : Install Module Packages
109
+ run : |
110
+ pnpm i --frozen-lockfile
111
+ pnpm sync
112
+ - name : Unit Test
113
+ run : |
114
+ pnpm test
115
+
116
+ # ############### PUBLISH #################
117
+ PUBLISH_WEBAPP :
118
+ name : Publish WebApp
119
+ environment : PREVIEW
120
+ runs-on : ubuntu-latest
121
+ needs : [INSTALL, LINT, VERIFY, UNIT_TEST]
122
+ steps :
123
+ - uses : actions/checkout@v4
124
+ - uses : pnpm/action-setup@v3
125
+ with :
126
+ version : 9.12.1
127
+ - uses : actions/setup-node@v3
128
+ with :
129
+ node-version : ' 22.9.0'
130
+ - uses : actions/cache@v3
131
+ with :
132
+ path : ./node_modules
133
+ key : ${{ runner.os }}-${{ hashFiles('./pnpm-lock.yaml', '/.npmrc') }}
134
+ - name : Install Module Packages
135
+ run : |
136
+ pnpm i --frozen-lockfile
137
+ pnpm sync
58
138
- name : Build
59
139
env :
60
140
IS_CI : false
61
141
run : |
62
- pnpm build:prod
63
- - name : Publish to Cloudflare Pages
142
+ pnpm turbo @cloudkit/web# build
143
+ - name : Publish
64
144
uses : cloudflare/pages-action@v1
65
145
with :
66
146
apiToken : ${{ secrets.CLOUDFLARE_API_TOKEN }}
67
147
accountId : ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
68
148
projectName : cloudkit
149
+ workingDirectory : ./apps/web/
69
150
directory : ./.svelte-kit/cloudflare
70
151
# Optional: Enable this if you want to have GitHub Deployments triggered
152
+ gitHubToken : ${{ secrets.GITHUB_TOKEN }}
71
153
# Optional: Switch what branch you are publishing to.
72
154
# By default this will be the branch which triggered this workflow
73
- # branch: master
155
+ branch : ${{ github.head_ref }}
74
156
# Optional: Change the working directory
75
- # workingDirectory: my-site
76
157
# Optional: Change the Wrangler version, allows you to point to a specific version or a tag such as `beta`
77
158
wranglerVersion : ' 3'
159
+ PUBLISH_STORYBOOK :
160
+ name : Publish Storybook
161
+ environment : PREVIEW
162
+ runs-on : ubuntu-latest
163
+ needs : [INSTALL, LINT, VERIFY, UNIT_TEST]
164
+ steps :
165
+ - uses : actions/checkout@v4
166
+ - uses : pnpm/action-setup@v3
167
+ with :
168
+ version : 9.12.1
169
+ - uses : actions/setup-node@v3
170
+ with :
171
+ node-version : ' 22.9.0'
172
+ - uses : actions/cache@v3
173
+ with :
174
+ path : ./node_modules
175
+ key : ${{ runner.os }}-${{ hashFiles('./pnpm-lock.yaml', '/.npmrc') }}
176
+ - name : Install Module Packages
177
+ run : |
178
+ pnpm i --frozen-lockfile
179
+ pnpm sync
180
+ - name : Build
181
+ env :
182
+ IS_CI : false
183
+ run : |
184
+ pnpm turbo run @cloudkit/styleguide#build
185
+ - name : Publish
186
+ uses : cloudflare/pages-action@v1
187
+ with :
188
+ apiToken : ${{ secrets.CLOUDFLARE_API_TOKEN }}
189
+ accountId : ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
190
+ projectName : cloudkit-styleguide
191
+ workingDirectory : ./apps/styleguide/
192
+ directory : ./storybook-static
193
+ # Optional: Enable this if you want to have GitHub Deployments triggered
194
+ gitHubToken : ${{ secrets.GITHUB_TOKEN }}
195
+ # Optional: Switch what branch you are publishing to.
196
+ # By default this will be the branch which triggered this workflow
197
+ branch : ${{ github.head_ref }}
198
+ # Optional: Change the working directory
199
+ # Optional: Change the Wrangler version, allows you to point to a specific version or a tag such as `beta`
200
+ wranglerVersion : ' 3'
201
+
202
+ PUBLISH_SWAGGER :
203
+ name : Publish Swagger UI
204
+ environment : PREVIEW
205
+ runs-on : ubuntu-latest
206
+ needs : [INSTALL, LINT, VERIFY, UNIT_TEST]
207
+ steps :
208
+ - uses : actions/checkout@v4
209
+ - uses : pnpm/action-setup@v3
210
+ with :
211
+ version : 9.12.1
212
+ - uses : actions/setup-node@v3
213
+ with :
214
+ node-version : ' 22.9.0'
215
+ - uses : actions/cache@v3
216
+ with :
217
+ path : ./node_modules
218
+ key : ${{ runner.os }}-${{ hashFiles('./pnpm-lock.yaml', '/.npmrc') }}
219
+ - name : Install Module Packages
220
+ run : |
221
+ pnpm i --frozen-lockfile
222
+ pnpm sync
223
+ - name : Build
224
+ env :
225
+ IS_CI : false
226
+ run : |
227
+ pnpm turbo run @cloudkit/swagger-ui#build
228
+ - name : Publish
229
+ uses : cloudflare/pages-action@v1
230
+ with :
231
+ apiToken : ${{ secrets.CLOUDFLARE_API_TOKEN }}
232
+ accountId : ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
233
+ projectName : cloudkit-api
234
+ workingDirectory : ./apps/swagger-ui/
235
+ directory : ./.svelte-kit/cloudflare
236
+ # Optional: Enable this if you want to have GitHub Deployments triggered
237
+ gitHubToken : ${{ secrets.GITHUB_TOKEN }}
238
+ # Optional: Switch what branch you are publishing to.
239
+ # By default this will be the branch which triggered this workflow
240
+ branch : ${{ github.head_ref }}
241
+ # Optional: Change the working directory
242
+ # Optional: Change the Wrangler version, allows you to point to a specific version or a tag such as `beta`
243
+ wranglerVersion : ' 3'
244
+
245
+
246
+ # Disable until I can figure out a way to deal with the flaky tests
247
+ # E2E_TEST:
248
+ # name: Run E2E Tests
249
+ # needs: [INSTALL]
250
+ # runs-on: ubuntu-latest
251
+ # steps:
252
+ # - name: Setup FFmpeg
253
+ # uses: AnimMouse/setup-ffmpeg@v1
254
+ # - uses: actions/checkout@v4
255
+ # - name: Set up Services
256
+ # run: |
257
+ # sudo docker-compose up -d
258
+ # - uses: pnpm/action-setup@v3
259
+ # with:
260
+ # version: 9.12.1
261
+ # - uses: actions/setup-node@v3
262
+ # with:
263
+ # node-version: '22.9.0'
264
+ # cache: 'pnpm'
265
+ # - uses: actions/cache@v3
266
+ # with:
267
+ # path: ./node_modules
268
+ # key: ${{ runner.os }}-${{ hashFiles('./pnpm-lock.yaml', '/.npmrc) }}
269
+ # - name: Prisma Generate
270
+ # run: |
271
+ # pnpm prisma:gen:dev
272
+ # - name: Prisma Push
273
+ # run: |
274
+ # pnpm prisma:push:dev
275
+ # - name: Install Playwright Browsers
276
+ # run: |
277
+ # pnpm exec playwright install
278
+ # pnpm playwright install-deps chromium
279
+ # - name: e2e Test
280
+ # run: |
281
+ # pnpm run test:e2e:ci
282
+ # - uses: actions/upload-artifact@v4
283
+ # if: ${{ !cancelled() }}
284
+ # with:
285
+ # name: playwright-report
286
+ # path: test-results/
287
+ # retention-days: 5
288
+
0 commit comments