Cache
Gitlab 的缓存不能用来存储build的结果,只能用来作为临时项目依赖的存储
每个 Gitlab CI 任务要下载cache文件;然后解压;任务完成之后,再压缩上传新的同名cache
# 全局缓存
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- node_modules/
stages:
- build
- test
build website:
stage: build
image: node
script:
- npm install
- npm install -g gatsby-cli
- gtsby build
artifacts:
paths:
- ./public
test artifacts:
image: alpine
stage: test
script:
- grep "Gasby" ./public/index.html
Cache 可能由于多次上传下载导致差异不可用。需要在job任务栏清理cache
网友评论