diff --git a/README.md b/README.md index ba3bae74..2d0856e7 100644 --- a/README.md +++ b/README.md @@ -78,10 +78,29 @@ details. Otherwise if you update a patch then the change may not be reflected on subsequent CI runs. - E.g., for CircleCI: before loading/saving your cache run - `cat patches/* | md5 > patches.hash` and then update your hash key to include - a checksum of that file, - `{{ checksum "yarn.lock" }}-{{ checksum "patches.hash" }}`. + +### CircleCI +Create a hash of your patches before loading/saving your cache. If using a Linux machine, run `md5sum patches/* > patches.hash`. If running on a macOS machine, use `md5 patches/* > patches.hash` +```yaml +- run: + name: patch-package hash + command: md5sum patches/* > patches.hash +``` + +Then, update your hash key to include a checksum of that file: +```yaml +- restore_cache: + key: app-node_modules-v1-{{ checksum "yarn.lock" }}-{{ checksum "patches.hash" }} +``` + +As well as the save_cache +```yaml +- save_cache: + key: app-node_modules-v1-{{ checksum "yarn.lock" }}-{{ checksum "patches.hash" }} + paths: + - ./node_modules +``` + ## Usage