jekyll - 启用缓存时 GitLab CI/CD jekyll 构建失败
问题描述
我正在使用 GitLab CI/CD 管道来构建和部署一个 jekyll 网站。当我没有激活缓存时,以下设置有效。
image: ruby:2.6
# Cache gems in between builds
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- vendor/ruby
before_script:
- gem install bundler
#- ruby -v # Print out ruby version for debugging
#- apt-get update -q && apt-get install nodejs -yqq
#- bundle install --path vendor # Install dependencies into ./vendor/ruby
- bundle install
build:
stage: build
script:
- bundle exec jekyll build -d public
artifacts:
paths:
- public
only:
- master
- develop
master-deploy:
stage: deploy
before_script:
# Install ssh client
- apt-get update
- apt-get install openssh-client
# Set up keys
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo "$PRIVATE_KEY" > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
# Set up known hosts
- echo "$KNOWN_HOST" > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
script:
# Install rsync
- apt-get update -qy
- apt-get install -y rsync
# Transfer files
...
# Backup old versions
...
only:
- master
develop-deploy:
stage: deploy
before_script:
# Install ssh client
- apt-get update
- apt-get install openssh-client
# Set up keys
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo "$PRIVATE_KEY" > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
# Set up known hosts
- echo "$KNOWN_HOST" > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
script:
# Install rsync
- apt-get update -qy
- apt-get install -y rsync
# Transfer files
...
# Backup old version
...
only:
- develop
一旦我激活缓存build install --path vendor
,我就会收到以下错误:
Liquid Exception: Liquid syntax error (line 8): Unknown tag 'when' in vendor/ruby/2.6.0/gems/liquid-4.0.3/lib/liquid/locales/en.yml
jekyll 3.8.6 | Error: Liquid syntax error (line 8): Unknown tag 'when'
我已经删除了 GitLab 上的缓存(CI/CD->Pipelines->Clear runner cache),但没有成功。任何帮助表示赞赏
解决方案
推荐阅读
- assembly - gdb以错误的顺序读取汇编x86指令
- reactjs - 如何在 redux 操作中访问反应上下文和/或挂钩
- spring-boot - 使用 Azure Keyvault 的 IBM MQ 客户端
- php - Foreach 循环 JSON 获取特定值
- c++ - 我的第一个 C++ 项目的未定义引用链接器错误
- python - 如何创建条形图来显示 python pandas 中每个唯一哈希的真值和假值
- wpf - WPF:当第二列内容折叠时,DataGrid 不会扩展以占据 Grid 的两列
- scala - 当我有“thunk”时如何覆盖方法
- javascript - 在 Internet Explorer 下载参数上通过 REST API 获取的保存虚拟文件不起作用
- c - 为什么我必须输入 3 个数字而不是 2 个?