Skip to content

Instantly share code, notes, and snippets.

@hzbd
Forked from ipmb/fab_sphinx_to_github_page.py
Created April 23, 2013 18:26
Show Gist options
  • Save hzbd/5446097 to your computer and use it in GitHub Desktop.
Save hzbd/5446097 to your computer and use it in GitHub Desktop.
import os
from fabric.api import *
env.local_root=os.path.dirname(__file__)
def deploy_github():
with lcd(env.local_root):
local('git checkout master')
commit = local('git log -1|grep commit', capture=True)
local('make clean && make html')
local('git checkout gh-pages')
local('cp -r _build/html/* .')
local('git add .')
local('git commit -a -m "Build up to %s"' % commit)
local('git push origin gh-pages')
local('git checkout master')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment