Skip to content

Commit 2273d06

Browse files
ci(github): fix cache dependencies in workflow build.yml
1 parent 18d3399 commit 2273d06

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
timeout-minutes: 5
88
strategy:
99
matrix:
10-
node-version: [14]
10+
node-version: [16]
1111

1212
steps:
1313
- name: Checkout repository
@@ -20,19 +20,18 @@ jobs:
2020
with:
2121
node-version: ${{ matrix.node-version }}
2222

23-
- name: Cache node modules
23+
- name: Cache dependencies
2424
uses: actions/cache@v2
25-
env:
26-
cache-name: cache-node-modules
2725
with:
28-
# npm cache files are stored in `~/.npm` on Linux/macOS
29-
path: ~/.npm
30-
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
31-
restore-keys: |
32-
${{ runner.os }}-node-
26+
path: |
27+
node_modules
28+
*/*/node_modules
29+
key: ${{ runner.os }}-${{ hashFiles('**/package.json', './package.json') }}
30+
id: cache
3331

3432
- name: Install dependencies
35-
run: npm install
33+
if: steps.cache.outputs.cache-hit != 'true'
34+
run: npm install --prefer-offline
3635

3736
- name: Lint commit message
3837
run: npx commitlint --from=HEAD~1

0 commit comments

Comments
 (0)