From 11b19a4f4b6c78f10572c7cab8b5bb527a8f699b Mon Sep 17 00:00:00 2001 From: Michael Bryan Date: Wed, 17 Jan 2018 12:30:45 +0800 Subject: [PATCH] Created a couple basic CI scripts --- .travis.yml | 17 +++++++++++++++++ ci/github_pages.sh | 10 ++++++++++ ci/install.sh | 6 ++++++ 3 files changed, 33 insertions(+) create mode 100644 .travis.yml create mode 100644 ci/github_pages.sh create mode 100644 ci/install.sh diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..e1fcfa9bf --- /dev/null +++ b/.travis.yml @@ -0,0 +1,17 @@ +language: rust + +cache: pip + +install: + - bash ci/install.sh + - source ~/.cargo/env || true + +script: + - true + +after_success: + - bash ci/github_pages.sh + +notifications: + email: + on_success: never \ No newline at end of file diff --git a/ci/github_pages.sh b/ci/github_pages.sh new file mode 100644 index 000000000..603b280f9 --- /dev/null +++ b/ci/github_pages.sh @@ -0,0 +1,10 @@ +#!/bin/bash +set -ex + +BOOK_DIR=book + +# Only upload the built book to github pages if it's a commit to master +if [ "$TRAVIS_BRANCH" = master -a "$TRAVIS_PULL_REQUEST" = false ]; then + mdbook build + ghp-import $BOOK_DIR +fi \ No newline at end of file diff --git a/ci/install.sh b/ci/install.sh new file mode 100644 index 000000000..d9cb369e5 --- /dev/null +++ b/ci/install.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -ex + +if command -v ghp-import >/dev/null 2>&1; then + pip install ghp-import +fi \ No newline at end of file