我想在 GitLab 页面上托管使用 Sphinx 生成的静态页面。已建 index.html
文件在:
project/docs/build/html
如何
.gitlab-ci.yml
应该看起来像部署页面?我有类似的东西,但它不起作用:pages:
stage: deploy
script:
- echo 'Nothing to do...'
artifacts:
paths:
- docs/build/html
only:
- master
最佳答案
根据documentation for .gitlab-ci.yml , pages
工作有它必须遵循的特殊规则:
- Any static content must be placed under a
public/
directoryartifacts
with a path to thepublic/
directory must be defined
所以例子
.gitlab-ci.yml
你给的看起来像这样:pages:
stage: deploy
script:
- mv docs/build/html/ public/
artifacts:
paths:
- public
only:
- master
当然,如果您不想移动
html
无论出于何种原因,您都可以复制它。如需进一步引用,an example
sphinx
project for GitLab Pages在您最初发布此问题时被推送。
关于GitLab 页面,使用 sphinx 生成的文档,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48223039/