Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
0255a858
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0255a858
编写于
3月 07, 2016
作者:
A
Achilleas Pipinellis
提交者:
James Edwards-Jones
1月 31, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use the default ruby:2.1 image
上级
aaebb216
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
17 addition
and
9 deletion
+17
-9
doc/pages/README.md
doc/pages/README.md
+17
-9
未找到文件。
doc/pages/README.md
浏览文件 @
0255a858
...
...
@@ -224,15 +224,17 @@ specific to your static generator.
The example below, uses [Jekyll] to build the static site:
```
yaml
pages
:
images
:
jekyll/jekyll:latest
image
:
ruby:2.1
# the script will run in Ruby 2.1 using the Docker image ruby:2.1
pages
:
# the build job must be named pages
script
:
-
jekyll build -d public/
-
gem install jekyll
# we install jekyll
-
jekyll build -d public/
# we tell jekyll to build the site for us
artifacts
:
paths
:
-
public
-
public
# this is where the site will live and the Runner uploads it in GitLab
only
:
-
master
-
master
# this script is only affecting the master branch
```
Here, we used the Docker executor and in the first line we specified the base
...
...
@@ -241,7 +243,11 @@ image against which our builds will run.
You have to make sure that the generated static files are ultimately placed
under the
`public`
directory, that's why in the
`script`
section we run the
`jekyll`
command that builds the website and puts all content in the
`public/`
directory.
directory. Depending on the static generator of your choice, this command will
differ. Search in the documentation of the static generator you will use if
there is an option to explicitly set the output directory. If there is not
such an option, you can always add one more line under
`script`
to rename the
resulting directory in
`public/`
.
We then tell the Runner to treat the
`public/`
directory as
`artifacts`
and
upload it to GitLab.
...
...
@@ -251,8 +257,8 @@ upload it to GitLab.
See the
[
jekyll example project
][
pages-jekyll
]
to better understand how this
works.
For a list of Pages projects, see
[
example projects
](
#example-projects
)
to get
you started.
For a list of Pages projects, see
the
[
example projects
](
#example-projects
)
to
get
you started.
#### How to set up GitLab Pages in a repository where there's also actual code
...
...
@@ -279,9 +285,11 @@ Below is a copy of `.gitlab-ci.yml` where the most significant line is the last
one, specifying to execute everything in the
`pages`
branch:
```
image: ruby:2.1
pages:
images: jekyll/jekyll:latest
script:
- gem install jekyll
- jekyll build -d public/
artifacts:
paths:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录