Skip to content

Commit

Permalink
feat(npm-install): improve speed
Browse files Browse the repository at this point in the history
- now caches node_modules instead of npm cache
  • Loading branch information
EdieLemoine committed May 18, 2022
1 parent 0572ddf commit fb19db3
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions npm-install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,20 @@ inputs:
runs:
using: composite
steps:
- uses: myparcelnl/actions/setup-node@v1
- uses: actions/setup-node@v3
with:
node-version: ${{ inputs.node-version }}

- name: 'Prepare npm cache'
uses: actions/cache@v2
- name: 'Prepare node_modules cache'
uses: actions/cache@v3
id: cache
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
path: node_modules
key: ${{ runner.os }}-npm-node_modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
${{ runner.os }}-npm-node_modules-
- name: 'Install npm dependencies'
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci
shell: bash

0 comments on commit fb19db3

Please sign in to comment.