Skip to content

Commit 59f2a9b

Browse files
authored
Merge pull request #1373 from avisionh/docs/ci-guide-update
Docs: CI guide update
2 parents 552e337 + 75d0f1e commit 59f2a9b

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

guide/src/continuous-integration.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ permissions (or "repo" for private repositories). Go to your repository's Travis
3939
CI settings page and add an environment variable named `GITHUB_TOKEN` that is
4040
marked secure and *not* shown in the logs.
4141

42+
Whilst still in your repository's settings page, navigate to Options and change the
43+
Source on GitHub pages to `gh-pages`.
44+
4245
Then, append this snippet to your `.travis.yml` and update the path to the
4346
`book` directory:
4447

@@ -55,6 +58,40 @@ deploy:
5558

5659
That's it!
5760

61+
Note: Travis has a new [dplv2](https://blog.travis-ci.com/2019-08-27-deployment-tooling-dpl-v2-preview-release) configuration that is currently in beta. To use this new format, update your `.travis.yml` file to:
62+
63+
```yaml
64+
language: rust
65+
os: linux
66+
dist: xenial
67+
68+
cache:
69+
- cargo
70+
71+
rust:
72+
- stable
73+
74+
before_script:
75+
- (test -x $HOME/.cargo/bin/cargo-install-update || cargo install cargo-update)
76+
- (test -x $HOME/.cargo/bin/mdbook || cargo install --vers "^0.3" mdbook)
77+
- cargo install-update -a
78+
79+
script:
80+
- mdbook build path/to/mybook && mdbook test path/to/mybook
81+
82+
deploy:
83+
provider: pages
84+
strategy: git
85+
edge: true
86+
cleanup: false
87+
github-token: $GITHUB_TOKEN
88+
local-dir: path/to/mybook/book
89+
keep-history: false
90+
on:
91+
branch: master
92+
target_branch: gh-pages
93+
```
94+
5895
### Deploying to GitHub Pages manually
5996

6097
If your CI doesn't support GitHub pages, or you're deploying somewhere else

guide/src/misc/contributors.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@ shout-out to them!
1616
- [Phaiax](https://github.com/Phaiax)
1717
- Matt Ickstadt ([mattico](https://github.com/mattico))
1818
- Weihang Lo ([@weihanglo](https://github.com/weihanglo))
19+
- Avision Ho ([@avisionh](https://github.com/avisionh))
1920

20-
If you feel you're missing from this list, feel free to add yourself in a PR.
21+
If you feel you're missing from this list, feel free to add yourself in a PR.

0 commit comments

Comments
 (0)