使用 GitLab 页面托管静态网站
Host static website with GitLab pages
我需要用 gitlab 页面托管一个静态网站。我的存储库是一个私有存储库(或项目),我尝试使用的 .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 项目 url:https://gitlab.com/gpecchio/BeCall
您的网站是在 html 中创建的还是使用静态生成器创建您的网站然后使用 gitlab 页面托管它?
在 .gitlab-ci.yml 文件中,工件需要 public(即使您的存储库是私有的)以托管您的网站使用gitlab 页面。
这里有一些示例,说明您的 .gitlab-ci.yml 文件需要是什么样子才能使用 gitlab 页面托管您的网站。
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 主题
最后,link 你的 gitlab 项目 url: https://gitlab.com/gpecchio/BeCall 是私有的。
我需要用 gitlab 页面托管一个静态网站。我的存储库是一个私有存储库(或项目),我尝试使用的 .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 项目 url:https://gitlab.com/gpecchio/BeCall
您的网站是在 html 中创建的还是使用静态生成器创建您的网站然后使用 gitlab 页面托管它?
在 .gitlab-ci.yml 文件中,工件需要 public(即使您的存储库是私有的)以托管您的网站使用gitlab 页面。
这里有一些示例,说明您的 .gitlab-ci.yml 文件需要是什么样子才能使用 gitlab 页面托管您的网站。
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 主题最后,link 你的 gitlab 项目 url: https://gitlab.com/gpecchio/BeCall 是私有的。