Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
231e3a2b
Commit
231e3a2b
authored
Mar 04, 2016
by
Achilleas Pipinellis
Committed by
James Edwards-Jones
Jan 31, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add example of hosting Pages in a specific branch
[ci skip]
parent
50d32d6c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
2 deletions
+40
-2
doc/pages/README.md
doc/pages/README.md
+40
-2
No files found.
doc/pages/README.md
View file @
231e3a2b
...
...
@@ -256,8 +256,46 @@ you started.
#### How to set up GitLab Pages in a repository where there's also actual code
You can have your project's code in the
`master`
branch and use an orphan
`pages`
branch that will host your static generator site.
Remember that GitLab Pages are by default branch/tag agnostic and their
deployment relies solely on what you specify in
`.gitlab-ci.yml`
. You can limit
the
`pages`
job with the
[
`only` parameter
](
../ci/yaml/README.md#only-and-except
)
,
whenever a new commit is pushed to a branch that will be used specifically for
your pages.
That way, you can have your project's code in the
`master`
branch and use an
orphan branch (let's name it
`pages`
) that will host your static generator site.
You can create a new empty branch like this:
```
bash
git checkout
--orphan
pages
```
The first commit made on this new branch will have no parents and it will be
the root of a new history totally disconnected from all the other branches and
commits. Push the source files of your static generator in the
`pages`
branch.
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:
```
pages:
images: jekyll/jekyll:latest
script:
- jekyll build -d public/
artifacts:
paths:
- public
only:
- pages
```
See an example that has different files in the
[
`master` branch
][
jekyll-master
]
and the source files for Jekyll are in a
[
`pages` branch
][
jekyll-pages
]
which
also includes
`.gitlab-ci.yml`
.
[
jekyll-master
]:
https://gitlab.com/gitlab-examples/pages-jekyll-branched/tree/master
[
jekyll-pages
]:
https://gitlab.com/gitlab-examples/pages-jekyll-branched/tree/pages
## Next steps
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment