Fix up the deploy script

Actually generate the book, fixing the deploy script, as well as only
deploy when we merge, rather than on pull requests.