Skip to content

Commit 20b2454

Browse files
authored
ci: cache .next/cache (#318)
follow https://nextjs.org/docs/pages/guides/ci-build-caching#github-actions for hopefully faster builds
1 parent bd5feb9 commit 20b2454

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3-
41
name: Node.js CI
52

63
on:
@@ -18,34 +15,40 @@ jobs:
1815
strategy:
1916
matrix:
2017
node-version: [20.x, 22.x]
21-
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
2218

2319
steps:
24-
- uses: actions/checkout@v4
20+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2521
with:
2622
fetch-depth: 0
2723

2824
- name: Use Node.js ${{ matrix.node-version }}
29-
uses: actions/setup-node@v4
25+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
3026
with:
3127
registry-url: "https://registry.npmjs.org"
3228
node-version: ${{ matrix.node-version }}
3329

34-
- uses: actions/cache@v4
30+
- uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
3531
id: yarn-cache
3632
with:
3733
path: .yarn
3834
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
3935
restore-keys: |
4036
${{ runner.os }}-yarn-
4137
38+
- uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
39+
id: nextjs-cache
40+
with:
41+
path: packages/documentation/.next/cache
42+
key: ${{ runner.os }}-nextjs-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
43+
restore-keys: |
44+
${{ runner.os }}-nextjs-${{ hashFiles('yarn.lock') }}-
45+
4246
- run: corepack enable
47+
4348
- run: yarn --immutable
4449

4550
- run: yarn ci-build
46-
4751
- run: yarn ci-test
48-
4952
- run: yarn ci-lint
5053

5154
- run: yarn integration:generate

0 commit comments

Comments
 (0)