#!/usr/bin/env bash

CURRENT=`pwd`

make clean && make html

cd /tmp

mkdir clutchdocswork
cd clutchdocswork

git clone git@github.com:clutchio/clutchio.github.com.git
cd clutchio.github.com

git checkout --orphan master
git rm -rf .

cp -R $CURRENT/_build/html/* .
touch .nojekyll

git add .
git commit -a -m "Generate documentation site"

git push origin master --force

cd /tmp
rm -Rf /tmp/clutchdocswork