Skip to content

Commit d6129de

Browse files
committed
ci: fix prod-deploy.yml deps install
1 parent 0fedc35 commit d6129de

2 files changed

Lines changed: 45 additions & 26 deletions

File tree

.github/workflows/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ jobs:
348348
env:
349349
POSTGRES_USER: postgres
350350
POSTGRES_PASSWORD: postgres
351+
POSTGRES_DB: test_codeimage
351352
options: >-
352353
--health-cmd pg_isready
353354
--health-interval 10s

.github/workflows/prod-deploy.yml

Lines changed: 44 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ jobs:
1414
node-version: [16.14.2]
1515
steps:
1616
- uses: actions/checkout@v2
17-
with:
18-
ref: 'next'
1917
- uses: pnpm/action-setup@v2.2.2
2018
with:
2119
version: 7
@@ -34,8 +32,6 @@ jobs:
3432
runs-on: ubuntu-latest
3533
steps:
3634
- uses: actions/checkout@v2
37-
with:
38-
ref: 'next'
3935
- uses: pnpm/action-setup@v2.2.2
4036
with:
4137
version: 7
@@ -44,10 +40,13 @@ jobs:
4440
with:
4541
node-version: ${{ matrix.node-version }}
4642
cache: 'pnpm'
43+
- name: Install dependencies
44+
run: |
45+
pnpm --prefer-offline install
4746
- name: "[API] Generate Prisma Migration"
4847
run: |
4948
pnpm --filter=@codeimage/api exec prisma generate
50-
pnpm --filter=@codeimage/prisma-models
49+
pnpm --filter=@codeimage/prisma-models build
5150
5251
- name: Lint
5352
run: pnpm lint
@@ -58,8 +57,6 @@ jobs:
5857
runs-on: ubuntu-latest
5958
steps:
6059
- uses: actions/checkout@v2
61-
with:
62-
ref: 'next'
6360
- uses: pnpm/action-setup@v2.2.2
6461
with:
6562
version: 7
@@ -68,11 +65,14 @@ jobs:
6865
with:
6966
node-version: ${{ matrix.node-version }}
7067
cache: 'pnpm'
68+
- name: Install dependencies
69+
run: |
70+
pnpm --prefer-offline install
7171
7272
- name: "[API] Generate Prisma Migration"
7373
run: |
7474
pnpm --filter=@codeimage/api exec prisma generate
75-
pnpm --filter=@codeimage/prisma-models
75+
pnpm --filter=@codeimage/prisma-models build
7676
7777
- name: "Build packages"
7878
run: |
@@ -90,8 +90,6 @@ jobs:
9090
runs-on: ubuntu-latest
9191
steps:
9292
- uses: actions/checkout@v2
93-
with:
94-
ref: 'next'
9593
- uses: pnpm/action-setup@v2.2.2
9694
with:
9795
version: 7
@@ -100,11 +98,14 @@ jobs:
10098
with:
10199
node-version: ${{ matrix.node-version }}
102100
cache: 'pnpm'
101+
- name: Install dependencies
102+
run: |
103+
pnpm --prefer-offline install
103104
104105
- name: "[API] Generate Prisma Migration"
105106
run: |
106107
pnpm --filter=@codeimage/api exec prisma generate
107-
pnpm --filter=@codeimage/prisma-models
108+
pnpm --filter=@codeimage/prisma-models build
108109
109110
- name: Build
110111
run: |
@@ -130,6 +131,7 @@ jobs:
130131
env:
131132
POSTGRES_USER: postgres
132133
POSTGRES_PASSWORD: postgres
134+
POSTGRES_DB: test_codeimage
133135
options: >-
134136
--health-cmd pg_isready
135137
--health-interval 10s
@@ -152,8 +154,6 @@ jobs:
152154

153155
steps:
154156
- uses: actions/checkout@v2
155-
with:
156-
ref: 'next'
157157
- uses: pnpm/action-setup@v2.2.2
158158
with:
159159
version: 7
@@ -166,10 +166,11 @@ jobs:
166166
run: |
167167
pnpm --prefer-offline install
168168
169-
- name: "[API] Generate Prisma Migration"
169+
- name: "Run prisma DB migrations"
170170
run: |
171+
pnpm --filter=@codeimage/api exec prisma migrate deploy
171172
pnpm --filter=@codeimage/api exec prisma generate
172-
pnpm --filter=@codeimage/prisma-models
173+
pnpm --filter=@codeimage/prisma-models build
173174
174175
- name: Test
175176
run: pnpm --filter=@codeimage/api test:ci
@@ -180,8 +181,6 @@ jobs:
180181
runs-on: ubuntu-latest
181182
steps:
182183
- uses: actions/checkout@v2
183-
with:
184-
ref: 'next'
185184
- uses: pnpm/action-setup@v2.2.2
186185
with:
187186
version: 7
@@ -190,6 +189,9 @@ jobs:
190189
with:
191190
node-version: ${{ matrix.node-version }}
192191
cache: 'pnpm'
192+
- name: Install dependencies
193+
run: |
194+
pnpm --prefer-offline install
193195
194196
- name: Restore packages
195197
uses: actions/cache@v3
@@ -213,14 +215,22 @@ jobs:
213215
runs-on: ubuntu-latest
214216
steps:
215217
- uses: actions/checkout@v2
216-
with:
217-
ref: 'next'
218218
- uses: pnpm/action-setup@v2.2.2
219+
with:
220+
version: 7
221+
- name: Use Node.js ${{ matrix.node-version }}
222+
uses: actions/setup-node@v3
223+
with:
224+
node-version: ${{ matrix.node-version }}
225+
cache: 'pnpm'
219226
- name: Restore packages
220227
uses: actions/cache@v3
221228
with:
222229
path: packages
223230
key: packages-dist-${{ github.run_id }}-${{ github.run_number }}
231+
- name: Install dependencies
232+
run: |
233+
pnpm --prefer-offline install
224234
225235
- name: Build @codeimage/ui/dev
226236
env:
@@ -244,14 +254,22 @@ jobs:
244254
runs-on: ubuntu-latest
245255
steps:
246256
- uses: actions/checkout@v2
247-
with:
248-
ref: 'next'
249257
- uses: pnpm/action-setup@v2.2.2
258+
with:
259+
version: 7
260+
- name: Use Node.js ${{ matrix.node-version }}
261+
uses: actions/setup-node@v3
262+
with:
263+
node-version: ${{ matrix.node-version }}
264+
cache: 'pnpm'
250265
- name: Restore packages
251266
uses: actions/cache@v3
252267
with:
253268
path: packages
254269
key: packages-dist-${{ github.run_id }}-${{ github.run_number }}
270+
- name: Install dependencies
271+
run: |
272+
pnpm --prefer-offline install
255273
256274
- name: Build @codeimage/highlight/dev
257275
env:
@@ -271,12 +289,10 @@ jobs:
271289
deploy-api:
272290
name: Build Api
273291
environment: Production
274-
needs: [ install, lint, typecheck-packages, build-api ]
292+
needs: [ install, lint, typecheck-packages, test-api, build-api ]
275293
runs-on: ubuntu-latest
276294
steps:
277295
- uses: actions/checkout@v2
278-
with:
279-
ref: 'next'
280296
- uses: pnpm/action-setup@v2.2.2
281297
with:
282298
version: 7
@@ -292,6 +308,10 @@ jobs:
292308
path: packages
293309
key: packages-dist-${{ github.run_id }}-${{ github.run_number }}
294310

311+
- name: Install dependencies
312+
run: |
313+
pnpm --prefer-offline install
314+
295315
- name: Restore api build
296316
uses: actions/cache@v3
297317
with:
@@ -327,8 +347,6 @@ jobs:
327347
runs-on: ubuntu-latest
328348
steps:
329349
- uses: actions/checkout@v2
330-
with:
331-
ref: 'next'
332350
- uses: pnpm/action-setup@v2.2.2
333351
with:
334352
version: 7

0 commit comments

Comments
 (0)