This commit is contained in:
Jorge Aparicio
2018-08-10 00:00:41 -05:00
parent e565f970e5
commit 4c004db265
4 changed files with 61 additions and 0 deletions

20
.travis.yml Normal file
View File

@@ -0,0 +1,20 @@
language: rust
install:
- bash ci/install.sh
script:
- bash ci/script.sh
after_success:
- bash ci/after-success.sh
branches:
only:
- master
- staging
- trying
notifications:
email:
on_success: never

17
ci/after-success.sh Normal file
View File

@@ -0,0 +1,17 @@
set -euxo pipefail
main() {
mkdir ghp-import
curl -Ls https://github.com/davisp/ghp-import/archive/master.tar.gz |
tar --strip-components 1 -C ghp-import -xz
./ghp-import/ghp_import.py book
# NOTE(+x) don't print $GH_TOKEN to the console!
set +x
git push -fq https://$GH_TOKEN@github.com/$TRAVIS_REPO_SLUG.git gh-pages && echo OK
}
if [ $TRAVIS_BRANCH = master ] && [ $TRAVIS_PULL_REQUEST = false ]; then
main
fi

15
ci/install.sh Normal file
View File

@@ -0,0 +1,15 @@
set -euxo pipefail
main() {
local tag=$(git ls-remote --tags --refs --exit-code https://github.com/rust-lang-nursery/mdbook \
| cut -d/ -f3 \
| grep -E '^v[0.1.0-9.]+$' \
| sort --version-sort \
| tail -n1)
curl -LSfs https://japaric.github.io/trust/install.sh | \
sh -s -- --git rust-lang-nursery/mdbook --tag $tag
pip install linkchecker --user
}
main

9
ci/script.sh Normal file
View File

@@ -0,0 +1,9 @@
set -euxo pipefail
main() {
mdbook build
linkchecker book
}
main