你好,我刚刚将我的网站升级到 Jekyll 4.0.0,编译开始需要很长时间。有时长达 10 分钟。但是当我在本地使用增量构建时,它能够在几秒钟内生成编译版本。所以我尝试缓存我能找到的所有与 Jekyll 相关的缓存。我正在使用 CircleCI 这是我的 config.yml
- save_cache:
key: site-cache-260320
paths:
- _site
- .jekyll-cache
- .jekyll-metadata
- .sass-cache
当 CircleCI 作业启动时,这会将缓存文件夹恢复到 repo。但它们似乎并没有在编译过程中得到重用。这项工作总是需要将近 10 分钟的时间来编译。
我是否缺少缓存文件夹?我需要使用 Jekyll 选项吗?如果我可以将我的网站构建/部署时间缩短到几秒钟,那将改变生活。谢谢!
最佳答案
CircleCI documentation on caching还提到
CircleCI restores caches in the order of keys listed in the restore_cache step. Each cache key is namespaced to the project, and retrieval is prefix-matched. The cache will be restored from the first matching key
steps:
- restore_cache:
keys:
所以一定要配置你的
restore_cache
一步,与您同行save_cache
步。例如,请注意 the cache size .
关于ruby - Jekyll 4.0.0 不使用 CI 中的缓存构建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61017629/