move parts of gh-pages and heroku into helper

they are very similar, so it's best to reuse some of this code and share
it between the two