Skip to content

Instantly share code, notes, and snippets.

@codetot
Created October 14, 2021 07:41
Show Gist options
  • Save codetot/0e4bc8023f1b9ed2d496f2c1a60872cd to your computer and use it in GitHub Desktop.
Save codetot/0e4bc8023f1b9ed2d496f2c1a60872cd to your computer and use it in GitHub Desktop.
CircleCI Alias for npm restore cache, install npm and save cache
aliases:
restore_cache: &restore_cache
restore_cache:
name: Restore Npm Package Cache
keys:
- v{{ .Environment.versionCache }}-deps-{{ .Branch }}-{{ checksum "package-lock.json" }}-{{ checksum ".circleci/config.yml" }}
install_node_modules: &install_node_modules
run:
name: Install NPM dependencies
command: npm install
save_cache: &save_cache
save_cache:
name: Save NPM modules cache
key: v{{ .Environment.versionCache }}-deps-{{ .Branch }}-{{ checksum "package-lock.json" }}-{{ checksum ".circleci/config.yml" }}
paths:
- ./node_modules/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment