[英]How can I use GitLab pages to host webpages with a user input form, which updates a GitLab repo when saved?
[英]Host static website with GitLab pages
我需要使用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的链接是私有的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.