The 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 .yarn/cache
.
The 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/
For the 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.
For yarn
:
cache:- file: yarn.lockpath: node_modulesservices:frontend:build: yarn install --frozen-lockfile --production --prefer-offline