ruby - Jekyll 4.0.0 不使用 CI 中的缓存构建

标签 ruby github continuous-integration jekyll

你好,我刚刚将我的网站升级到 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/

相关文章:

ruby-on-rails - 供应商/ bundle 和 ruby 版本

github - 如何重置Github状态检查?

events - Github 上的 Pull Request Merge 向我的应用程序发送 POST 请求

maven - 如何在 Jenkinsfile 的脚本 block 中创建环境变量(声明性)

visual-studio - "delayed commit"如何与源代码控制存储库和 CI 服务器一起工作?

java - 设置本地 Sonar(服务器)与在 Eclipse 中使用所有插件 checkstyles、pmd、findbugs

ruby-on-rails - Ruby on Rails - 下拉菜单

ruby - Watir webdriver 鼠标悬停(悬停)- Firefox Chrome IE 之间的区别

sql - 使用模型延迟加载/缓存 SQL 查询结果

git - 如何区分 GitHub 中的两个分支?