From 60bc89c67954ecc322cfbc204b7370c976fd02be Mon Sep 17 00:00:00 2001 From: Andreas Heider Date: Thu, 1 Mar 2018 22:39:04 +0000 Subject: [PATCH] Use travis to build docs --- .travis.yml | 2 ++ scripts/install.sh | 0 scripts/publish-docs.sh | 25 +++++++++++++++++++++++++ 3 files changed, 27 insertions(+) mode change 100644 => 100755 scripts/install.sh create mode 100755 scripts/publish-docs.sh diff --git a/.travis.yml b/.travis.yml index d5500ad..4ec649e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,9 +15,11 @@ before_install: set -e install: - bash ./scripts/install.sh + - cargo install mdbook script: - make + - make docs cache: cargo: true diff --git a/scripts/install.sh b/scripts/install.sh old mode 100644 new mode 100755 diff --git a/scripts/publish-docs.sh b/scripts/publish-docs.sh new file mode 100755 index 0000000..20e6610 --- /dev/null +++ b/scripts/publish-docs.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +set -euxo pipefail + +pushd book + +echo -e "Initializing Git" +git init +git config user.name "Andreas Heider" +git config user.email "andreas@heider.io" + +git remote add upstream "https://$GH_TOKEN@github.com/ah-/anne-key.git" +git fetch upstream --quiet +git reset upstream/gh-pages --quiet + +touch . + +echo -e "Pushing changes to gh-pages" +git add -A . +git commit -m "rebuild pages at ${rev}" --quiet +git push -q upstream HEAD:gh-pages --quiet + +echo -e "Deployed docs to GitHub Pages" + +popd