Fix Travis CI Script

* The script has two `env:` sections. Combined them.
* Generate docs only after successful compilation (avoid broken documentation for broken code).
* Fix indentation