Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
build: store the NPM cache, not local node_modules
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Reed committed May 10, 2021
1 parent 2b24f2b commit d9f18bb
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,23 @@ commands:
- restore_cache:
name: Restore Package Cache
keys:
- npm-packages-{{ .Branch }}-{{ checksum "package-lock.json" }}
- npm-packages-{{ .Branch }}
- npm-packages-
- npm-packages-v2-{{ .Branch }}-{{ checksum "package-lock.json" }}
- npm-packages-v2-{{ .Branch }}
- npm-packages-v2-
- run:
name: Clean Old Cache Entries
command: |
if [ -d ~/.npm ]; then
find ~/.npm -type d -maxdepth 2 -ctime +14 -exec rm -rf {} \;
fi
- run:
name: Install Node Dependencies
command: npm --prefer-offline --no-progress ci
- save_cache:
name: Save Package Cache
key: npm-packages-{{ .Branch }}-{{ checksum "package-lock.json" }}
key: npm-packages-v2-{{ .Branch }}-{{ checksum "package-lock.json" }}
paths:
- node_modules/
- ~/.npm

jobs:
run-tests:
Expand Down

0 comments on commit d9f18bb

Please sign in to comment.