From cbfd75a821f7d2113656e5aadc3b98ecd0b2251a Mon Sep 17 00:00:00 2001 From: A Ho Date: Thu, 5 Nov 2020 21:43:52 +0000 Subject: [PATCH] Update CI section in guide for travis dpl-v2 This is so that the instructions work when deploying the book to GitHub pages via the gh-pages branch. --- guide/src/continuous-integration.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/guide/src/continuous-integration.md b/guide/src/continuous-integration.md index 50a92af0..32e0087c 100644 --- a/guide/src/continuous-integration.md +++ b/guide/src/continuous-integration.md @@ -12,7 +12,8 @@ run. ```yaml language: rust -sudo: false +os: linux +dist: xenial cache: - cargo @@ -39,18 +40,24 @@ permissions (or "repo" for private repositories). Go to your repository's Travis CI settings page and add an environment variable named `GITHUB_TOKEN` that is marked secure and *not* shown in the logs. +Whilst still in your repository's settings page, navigate to Options and change the +Source on GitHub pages to `gh-pages`. + Then, append this snippet to your `.travis.yml` and update the path to the `book` directory: ```yaml deploy: provider: pages - skip-cleanup: true + strategy: git + edge: true + cleanup: false github-token: $GITHUB_TOKEN local-dir: path/to/mybook/book keep-history: false on: branch: master + target_branch: gh-pages ``` That's it!