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