@@ -67,14 +67,14 @@ jobs:
6767 pnpm libs:build
6868
6969 - name : Cache packages
70- uses : actions/cache@v5
70+ uses : actions/cache/save @v5
7171 with :
7272 path : packages
7373 key : packages-dist-${{ github.run_id }}-${{ github.run_number }}
7474
7575 build-api :
7676 name : ' Build @codeimage/api'
77- needs : ['install']
77+ needs : ['install', 'build-packages' ]
7878 runs-on : ubuntu-latest
7979 steps :
8080 - name : Checkout PR
@@ -94,13 +94,18 @@ jobs:
9494 pnpm --filter=@codeimage/api build:ts
9595 pnpm prepare:api:deploy
9696
97- - name : Cache build
98- uses : actions/cache@v5
97+ - name : Cache api dist
98+ uses : actions/cache/save@v5
99+ with :
100+ path : apps/api/dist
101+ key : rest-api-dist-${{ github.run_id }}-${{ github.run_number }}
102+
103+ - name : Cache api bundle
104+ uses : actions/cache/save@v5
99105 with :
100106 path : |
101107 dist/api-bundle/**
102108 key : rest-api-bundle-${{ github.run_id }}-${{ github.run_number }}
103- restore-keys : rest-api-bundle-${{ github.run_id }}-${{ github.run_number }}
104109
105110 test-api :
106111 name : Api test
@@ -157,7 +162,7 @@ jobs:
157162
158163 typecheck-packages :
159164 name : Type-checking packages/**
160- needs : ['install', 'build-packages']
165+ needs : ['install', 'build-packages', 'build-api' ]
161166 runs-on : ubuntu-latest
162167 steps :
163168 - name : Checkout PR
@@ -168,11 +173,17 @@ jobs:
168173 uses : ./.github/actions/pnpm-install
169174
170175 - name : Restore packages
171- uses : actions/cache@v5
176+ uses : actions/cache/restore @v5
172177 with :
173178 path : packages
174179 key : packages-dist-${{ github.run_id }}-${{ github.run_number }}
175180
181+ - name : Restore api dist
182+ uses : actions/cache/restore@v5
183+ with :
184+ path : apps/api/dist
185+ key : rest-api-dist-${{ github.run_id }}-${{ github.run_number }}
186+
176187 - name : Typecheck packages
177188 run : |
178189 pnpm --filter='./packages/**' --recursive typecheck:ci
@@ -195,7 +206,7 @@ jobs:
195206 - name : 📥 Monorepo install
196207 uses : ./.github/actions/pnpm-install
197208 - name : Restore packages
198- uses : actions/cache@v5
209+ uses : actions/cache/restore @v5
199210 with :
200211 path : packages
201212 key : packages-dist-${{ github.run_id }}-${{ github.run_number }}
@@ -226,12 +237,12 @@ jobs:
226237 - name : 📥 Monorepo install
227238 uses : ./.github/actions/pnpm-install
228239 - name : Restore packages
229- uses : actions/cache@v5
240+ uses : actions/cache/restore @v5
230241 with :
231242 path : packages
232243 key : packages-dist-${{ github.run_id }}-${{ github.run_number }}
233244 - name : Restore api build
234- uses : actions/cache@v5
245+ uses : actions/cache/restore @v5
235246 with :
236247 path : |
237248 dist/api-bundle/**
@@ -267,7 +278,7 @@ jobs:
267278 uses : ./.github/actions/pnpm-install
268279
269280 - name : Restore packages
270- uses : actions/cache@v5
281+ uses : actions/cache/restore @v5
271282 with :
272283 path : packages
273284 key : packages-dist-${{ github.run_id }}-${{ github.run_number }}
@@ -314,7 +325,7 @@ jobs:
314325 - name : 📥 Monorepo install
315326 uses : ./.github/actions/pnpm-install
316327 - name : Restore packages
317- uses : actions/cache@v5
328+ uses : actions/cache/restore @v5
318329 with :
319330 path : packages
320331 key : packages-dist-${{ github.run_id }}-${{ github.run_number }}
0 commit comments