cache field is responsible for declaring what parts of your project directory you'd like to cache on disk for subsequent runs. For example, in a typical react application, you may want to cache the contents of
cache directive accepts a list of entries, each of which has a
path field and
file field, like so:
cache:- file: foo-file.foopath: foo-path/- file: bar-file.barpath: bar-path/
foo example above, Reploy will create a cache entry which points to
foo-path on the first run, and only when
foo-file.foo changes will Reploy invalidate the cache.
In summary, the
file field is used for cache validation, and the
path tells Reploy where to look for the contents of your cache.
cache:- file: yarn.lockpath: .cache/yarnservices:frontend:build: yarn install --frozen-lockfile --cache-folder .cache/yarn #do this for Yarn 1.x# for Yarn 2, use `yarn install --immutable --cache-folder .cache/yarn`
cache:- file: package.jsonpath: node_modulesservices:frontend:build: npm install