Skip to content

Commit

Permalink
Use Travis to publish manual on gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
PuercoPop committed Aug 19, 2016
1 parent b405f70 commit c0149d8
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
language: bash
sudo: required
dist: trusty

notifications:
- email: false

addons:
apt:
packages:
- texinfo

script:

after_success:
- bash ci-doc-gh-pages.sh
31 changes: 31 additions & 0 deletions ci-doc-gh-pages.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

set -o errexit -o nounset

if [ "$TRAVIS_BRANCH" != "master" ]
then
echo "This commit was made against the $TRAVIS_BRANCH and not the master! No deploy!"
exit 0
fi

rev=$(git rev-parse --short HEAD)

mkdir -p stage/_book

command -v texi2any >/dev/null 2>&1 || { echo >&2 "texi2any is required but it's not installed. Aborting."; exit 1; }
texi2any --html manual/clx.texinfo -o stage/_book

cd stage/_book

git init
git config user.name "Documentation Bot"
git config user.email "[email protected]"

git remote add upstream "https://$GH_TOKEN@github.com/PuercoPop/clx-manual-ci-test.git"
git fetch upstream
git reset upstream/gh-pages

touch .
git add -A .
git commit -m "rebuild pages at ${rev}"
git push -q upstream HEAD:gh-pages

0 comments on commit c0149d8

Please sign in to comment.