Skip to content

Instantly share code, notes, and snippets.

@Excape
Created November 26, 2016 19:46
Show Gist options
  • Save Excape/4738f26f076e926d724a8b7de02c3c59 to your computer and use it in GitHub Desktop.
Save Excape/4738f26f076e926d724a8b7de02c3c59 to your computer and use it in GitHub Desktop.
Deploy mkdocs to GH-Pages with Travis
#!/bin/bash
set -e # exit with nonzero exit code if anything fails
#Build with mkdocs into ./site
mkdocs build --clean
# Checkout gh-pages
git clone --branch gh-pages git@github.com:Excape/hsr-docs-hs16.git gh-pages
#sync site
rsync -av site/ gh-pages/
#commit
cd gh-pages
git config user.name "Travis CI"
git config user.email "r1suter@hsr.ch"
git add .
git commit -m "Deploy from Travis CI"
git push
mkdocs>=0.15.3
python-markdown-math>=0.2
before_install: sudo pip install -r requirements.txt
script: bash ./build.sh
sudo: required
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment