From d1721667b6302128727abbf4c346b2cf2f3cd255 Mon Sep 17 00:00:00 2001 From: Spencer Burris Date: Tue, 1 Dec 2020 13:25:28 -0800 Subject: [PATCH 1/2] Add instructions for publishing via GitLab Pages --- guide/src/continuous-integration.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/guide/src/continuous-integration.md b/guide/src/continuous-integration.md index e9dacc6e..f19b49cd 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:latest + variables: + CARGO_HOME: $CI_PROJECT_DIR/cargo + before_script: + - export PATH="$PATH:$CARGO_HOME/bin" + - mdbook --version || cargo install --debug 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! From 4615ce2f8c8b6bf4b6d3c5406b298e59ddffe241 Mon Sep 17 00:00:00 2001 From: Spencer Burris Date: Thu, 3 Dec 2020 21:30:39 -0800 Subject: [PATCH 2/2] Remove --debug from GitLab CI --- guide/src/continuous-integration.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/guide/src/continuous-integration.md b/guide/src/continuous-integration.md index f19b49cd..a528e8f6 100644 --- a/guide/src/continuous-integration.md +++ b/guide/src/continuous-integration.md @@ -133,12 +133,12 @@ stages: pages: stage: deploy - image: rust:latest + image: rust:alpine variables: CARGO_HOME: $CI_PROJECT_DIR/cargo before_script: - export PATH="$PATH:$CARGO_HOME/bin" - - mdbook --version || cargo install --debug mdbook + - mdbook --version || cargo install mdbook script: - mdbook build -d public only: