我需要使用gitlab页面托管一个静态网站。我的repo是一个私有存储库(或项目),我尝试使用的.gitlab-ci.yml
如下所示:
image: gpecchio:BeCall
pages:
stage: deploy
script:
- echo 'Nothing to do...'
artifacts:
paths:
- private
only:
- master
我相信image
是错误的,但我不知道要改变它。我做了一些研究,但GitLab页面没有那么多的在线教程。我怎么能改变这个文件才能使它工作?
其他可能有用的信息: GitLab用户名:gpecchio GitLab项目名称:BeCall GitLab项目网址:https://gitlab.com/gpecchio/BeCall
您的网站是用html创建的,还是使用静态生成器来创建您的网站,然后使用gitlab页面来托管它?
在.gitlab-ci.yml文件中,工件需要公开(即使您的存储库是私有的),以便使用gitlab页面托管您的网站。
以下是您使用gitlab页面托管站点时.gitlab-ci.yml文件需要的一些示例。
HTML
pages:
stage: deploy
script:
- mkdir .public
- cp -r * .public
- mv .public public
artifacts:
paths:
- public
only:
- master
杰奇
image: ruby:2.3
pages:
stage: deploy
script:
- gem install jekyll
- jekyll build -d public/
artifacts:
paths:
- public
only:
- master
HEXO
image: node:4.2.2
pages:
cache:
paths:
- node_modules/
script:
- npm install hexo-cli -g
- npm install
- hexo deploy
artifacts:
paths:
- public
only:
- master
您应该查看https://gitlab.com/pages/,其中包含使用所有不同的静态站点生成器创建的静态站点的示例,并使用gitlab页面托管。
您还可以在https://gitlab.com/groups/jekyll-themes的gitlab页面上找到一些Jekyll主题
最后,指向你的gitlab项目url:https://gitlab.com/gpecchio/BeCall的链接是私有的。