@@ -7,10 +7,10 @@ A comprehensive documentation of `GitLab Pages` can be found here: https://docs.
`GitLab CI` configuration file is a `YAML` file.
The configuration file begins with `image` declaration. It indicates to the `GitLab Runner` which [`Docker`](https://www.docker.com/) image it has to pull for executing the `CI` job.
Publishing a **bookdown** [@R-bookdown] website with [GitLab Pages](https://about.gitlab.com/features/pages/) is as easy as:
- hosting a repository on [GitLab](https://gitlab.com)
- adding a configuration file to the project
## Host a project on <code>GitLab</code> {-}
You will get a hosting service for your **bookdown** book (like GitHub Pages) and great features
which are not available with GitHub Actions:
As [`GitHub`](https://www.github.com), [`GitLab`](https://gitlab.com) is a web-based [`Git`](https://git-scm.com/) repository manager. Creating a new project on [`GitLab`](https://gitlab.com) is fairly intuitive for [`GitHub`](https://www.github.com) users. [`GitLab`](https://gitlab.com) users can create unlimitate private projects for free (see [here](https://about.gitlab.com/gitlab-com/)).
- **pull requests previews**
- **a review application dedicated to non git users that allows them to comment on these previews**
[`GitLab`](https://gitlab.com) also offers a continuous integration service ([`GitLab CI`](https://about.gitlab.com/features/gitlab-ci-cd/)) and a static websites hosting service ([`GitLab Pages`](https://about.gitlab.com/features/pages/)) in its free plan ^[CI pipelines are limited to 2,000 minutes per month].
These features are also present in the open source software [`GitLab Community Edition (CE)`](https://about.gitlab.com/products/).
## Host a project on GitLab {-}
## Add a `GitLab CI` configuration file {-}
As [GitHub](https://www.github.com), [GitLab](https://gitlab.com) is a web-based [Git](https://git-scm.com/) repository manager. Creating a new project on [GitLab](https://gitlab.com) is fairly intuitive for [GitHub](https://www.github.com) users. [GitLab](https://gitlab.com) users can create unlimitate private projects for free (see [here](https://about.gitlab.com/gitlab-com/)).
[GitLab](https://gitlab.com) also offers a continuous integration service ([GitLab CI](https://about.gitlab.com/features/gitlab-ci-cd/)) and a static websites hosting service ([GitLab Pages](https://about.gitlab.com/features/pages/)) in its free plan ^[CI pipelines are limited to 2,000 minutes per month].
These features are also present in the open source software [GitLab Community Edition (CE)](https://about.gitlab.com/products/) which is widely used in industry as a self hosted git repository manager.
## Add a GitLab CI configuration file {-}
Add the following `.gitlab-ci.yml` file in the root of the project:
@@ -57,8 +86,7 @@ For explanations, see section \@ref(CI-file-details).
## See the result {-}
When the `CI` job is done, the website is served on `GitLab Pages`.
When the CI job is done, the website is served on GitLab Pages.
CI jobs status can be found in `CI / CD menu > Jobs`. An example, [here](https://gitlab.com/RLesur/bookdown-gitlab-pages/-/jobs).
The address of the `GitLab Pages` project can be found in `Settings > Pages`. An example, [here](https://gitlab.com/RLesur/bookdown-gitlab-pages/pages).