Skip to content

Commit 61088f3

Browse files
committed
cache npm
1 parent 829ea7d commit 61088f3

File tree

1 file changed

+3
-19
lines changed

1 file changed

+3
-19
lines changed

.github/workflows/publish-npm.yml

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
with:
3434
node-version-file: '.nvmrc'
3535
registry-url: 'https://registry.npmjs.org'
36+
cache: 'npm'
3637

3738
- name: Configure git user name and email
3839
run: |
@@ -59,6 +60,7 @@ jobs:
5960
with:
6061
node-version-file: '.nvmrc'
6162
registry-url: 'https://registry.npmjs.org'
63+
cache: 'npm'
6264

6365
- name: Install all npm packages
6466
run: npm ci
@@ -88,25 +90,7 @@ jobs:
8890
with:
8991
node-version-file: '.nvmrc'
9092
registry-url: 'https://registry.npmjs.org'
91-
92-
- name: Cache node modules
93-
id: cache-npm
94-
uses: actions/cache@v3
95-
env:
96-
cache-name: cache-node-modules
97-
with:
98-
# npm cache files are stored in `~/.npm` on Linux/macOS
99-
path: ~/.npm
100-
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
101-
restore-keys: |
102-
${{ runner.os }}-build-${{ env.cache-name }}-
103-
${{ runner.os }}-build-
104-
${{ runner.os }}-
105-
106-
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
107-
name: List the state of node modules
108-
continue-on-error: true
109-
run: npm list
93+
cache: 'npm'
11094

11195
- name: Configure git user name and email
11296
run: |

0 commit comments

Comments
 (0)