summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Huss <eric@huss.org>2021-01-06 13:11:58 -0800
committerGitHub <noreply@github.com>2021-01-06 13:11:58 -0800
commit76cd39e5e28aab7de37b5d4ed9b189f5491c3313 (patch)
treeef78fbc66b53c0710ecfa563666f93ef72b5d569
parent09e7bb76dc1d1f565a0678a9f8d3caa0164631cb (diff)
parent4615ce2f8c8b6bf4b6d3c5406b298e59ddffe241 (diff)
Merge pull request #1390 from sburris0/gitlabci
Guide: Add instructions for publishing via GitLab Pages
-rw-r--r--guide/src/continuous-integration.md28
1 files changed, 28 insertions, 0 deletions
diff --git a/guide/src/continuous-integration.md b/guide/src/continuous-integration.md
index e9dacc6e..a528e8f6 100644
--- a/guide/src/continuous-integration.md
+++ b/guide/src/continuous-integration.md
@@ -124,3 +124,31 @@ deploy: book
git commit -m "deployed on $(shell date) by ${USER}" && \
git push origin gh-pages
```
+
+## Deploying Your Book to GitLab Pages
+Inside your repository's project root, create a file named `.gitlab-ci.yml` with the following contents:
+```yml
+stages:
+ - deploy
+
+pages:
+ stage: deploy
+ image: rust:alpine
+ variables:
+ CARGO_HOME: $CI_PROJECT_DIR/cargo
+ before_script:
+ - export PATH="$PATH:$CARGO_HOME/bin"
+ - mdbook --version || cargo install mdbook
+ script:
+ - mdbook build -d public
+ only:
+ - master
+ artifacts:
+ paths:
+ - public
+ cache:
+ paths:
+ - $CARGO_HOME/bin
+```
+
+After you commit and push this new file, GitLab CI will run and your book will be available!