Skip to content

Instantly share code, notes, and snippets.

@oprypin
Created June 22, 2017 17:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oprypin/88c2b5061ed356c9c2c0551a43be4003 to your computer and use it in GitHub Desktop.
Save oprypin/88c2b5061ed356c9c2c0551a43be4003 to your computer and use it in GitHub Desktop.
#!/bin/bash
sources_branch="master"
docs_branch="gh-pages"
set -o errexit
git checkout "$sources_branch"
rev="$(git rev-parse HEAD)"
crystal doc
git checkout "$docs_branch"
git ls-files | xargs rm
mv doc/* .
rmdir doc
git add -A
git commit -m "Generate docs ($rev)"
git push origin "$docs_branch"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment