CouscousPHP/Couscous — pull request #45 by mnapoli (2014-11-29 21:47:58+00:00)
Title: Deploy gh-pages branch from travis

## [WiP] for task #34

To safely deploy with couscus from a travis build we need to take this things into consideration:

- [x] Make sure the deployment is running only for master.
- [x] Make sure it is not a pull request.
- [ ] Make sure we deploy once per build. E.G. don't deploy for every PHP version tested :smile:
- [x] Decide what to use to deploy: [Private Key](http://stackoverflow.com/questions/23277391/pushing-to-github-from-travis-ci) or [Personal Access Token](http://stackoverflow.com/questions/18027115/committing-via-travis-ci-failing)
- More info on [Personal Access Token](https://medium.com/@nthgergo/publishing-gh-pages-with-travis-ci-53a8270e87db)

Step by step to achieve the deploy:

Terminology:

- **PAT** = Personal Access Token

1. Install Travis on CLI `$gem install travis`
2. `$travis login` in the repo directory, this is needed to encrypt the **PAT**.
3. Generate a **PAT** from your GitHub account: Settings >> Applications >> Personal Access Token
3.1 Giving it `public_repo` permission should be enough.
4. `$travis encrypt GH_TOKEN=PERSONALACCESSTOKENHERE --add`
4.1 The `--add` flag will automatically write the encrypted string to your `.travis.yml` file.

Feel free to add commits and keep working on this together.