This repository was archived by the owner on Aug 7, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ defaults: &defaults
60
60
- save_cache :
61
61
paths :
62
62
- node_modules
63
- key : v1 -dependencies-{{ checksum "package.json" }}
63
+ key : v2 -dependencies-{{ .Branch }}-{{ checksum "package.json" }}-{{ checksum "package-lock.json" }}
64
64
65
65
jobs :
66
66
checkout_code :
@@ -72,10 +72,15 @@ jobs:
72
72
# Restore node_modules from the last build
73
73
- restore_cache :
74
74
keys :
75
- # Get latest cache for this package.json
76
- - v1-dependencies-{{ checksum "package.json" }}
77
- # Fallback to the last available cache
78
- - v1-dependencies
75
+ # Get latest cache for this package.json and pacakge-lock.json
76
+ - v2-dependencies-{{ .Branch }}-{{ checksum "package.json" }}-{{ checksum "package-lock.json"}}
77
+ # Fallback to the current package.json
78
+ - v2-dependencies-{{ .Branch }}-{{ checksum "package.json" }}-
79
+ # Fallback to the last build for this branch
80
+ - v2-dependencies-{{ .Branch }}-
81
+ # Fallback to the last available master branch cache
82
+ - v2-dependencies-master-
83
+ # Don't go further down to prevent dependency issues from other branches
79
84
# Save project state for next steps
80
85
- persist_to_workspace :
81
86
root : /tmp
You can’t perform that action at this time.
0 commit comments