aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jorge Aparicio <jorge@japaric.io> 2018-08-27 14:44:47 +0200
committerGravatar Jorge Aparicio <jorge@japaric.io> 2018-08-27 14:44:47 +0200
commit2b6b513b8978ac63fd12ee7049c85fce1194a487 (patch)
tree996e1bd8ba137192311f078f49f1deb963c0d0d5
parent2ec5d59ee99c00315168ae89847c5e352f1aadf0 (diff)
downloadrtic-2b6b513b8978ac63fd12ee7049c85fce1194a487.tar.gz
rtic-2b6b513b8978ac63fd12ee7049c85fce1194a487.tar.zst
rtic-2b6b513b8978ac63fd12ee7049c85fce1194a487.zip
publish docs on gh pages
-rw-r--r--.travis.yml3
-rw-r--r--ci/after-success.sh20
2 files changed, 23 insertions, 0 deletions
diff --git a/.travis.yml b/.travis.yml
index 8e8aafb7..8e81e822 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -26,6 +26,9 @@ install:
script:
- bash ci/script.sh
+after_success:
+ - bash ci/after-success.sh
+
after_script: set +e
branches:
diff --git a/ci/after-success.sh b/ci/after-success.sh
new file mode 100644
index 00000000..43772674
--- /dev/null
+++ b/ci/after-success.sh
@@ -0,0 +1,20 @@
+set -euxo pipefail
+
+main() {
+ cargo doc
+
+ 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 target/doc
+
+ set +x
+ git push -fq https://$GH_TOKEN@github.com/$TRAVIS_REPO_SLUG.git gh-pages && echo OK
+}
+
+# only publish on successful merges to master
+if [ $TRAVIS_BRANCH = master ] && [ $TRAVIS_PULL_REQUEST = false ] && [ $TARGET = x86_64-unknown-linux-gnu ]; then
+ main
+fi