使用 GitLab 页面托管静态网站



我需要托管一个带有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文件中,工件必须是公共的(即使您的存储库是私有的(,以便使用 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

六角形

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 页面托管的静态站点的示例。

您还可以在 gitlab 页面上找到一些托管的 Jekyll 主题 https://gitlab.com/groups/jekyll-themes

最后,指向您的 gitlab 项目 url:https://gitlab.com/gpecchio/BeCall 的链接是私有的。

最新更新