Skip to content

Instantly share code, notes, and snippets.

@anlsh
Last active July 6, 2020 18:10
Show Gist options
  • Save anlsh/31cf321febe078c4db786a2a9439ceb9 to your computer and use it in GitHub Desktop.
Save anlsh/31cf321febe078c4db786a2a9439ceb9 to your computer and use it in GitHub Desktop.
Generates documentation for my repository's master branch on push and pushes it to github pages
#!/bin/sh
# prints a line accross the screen
git clone git@github.com:anlsh/anlsh.github.io.git /tmp/anlsh.github.io > /dev/null 2>&1
CURRHEAD=$(git rev-parse --abbrev-ref HEAD)
git stash > /dev/null
git checkout master > /dev/null 2>&1
rm -rf /tmp/anlsh.github.io/picl > /dev/null
sbcl \
--eval '(ql:quickload :staple)' \
--eval '(staple:generate :picl :output-directory #P"/tmp/anlsh.github.io/picl/")' \
--quit > /dev/null
git checkout $CURRHEAD > /dev/null 2>&1
git stash pop > /dev/null
FOO=$(git rev-parse master)
cd /tmp/anlsh.github.io
git init > /dev/null
git pull > /dev/null
git add picl/ > /dev/null
git commit -m "Generate docs for PICL:$FOO" > /dev/null
git push origin master > /dev/null
echo "Documentation (hopefully) generated and pushed"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment