Company
Date Published
Author
Liran Tal
Word count
646
Language
English
Hacker News points
None

Summary

Deploying a Gatsby site to GitHub Pages from Travis CI` A developer recently set up a static website using Gatsby and deployed it to GitHub Pages. They chose to use the `master` branch for their website's source code, which is hosted in the `docs/` directory, and pushed the generated static website files to the `gh-pages` branch. To automate this process, they used the `gh-pages` module with a GitHub token obtained through the personal access tokens feature. The developer created a new secret environment variable named `GH_TOKEN` in their Travis CI configuration and updated their `package.json` file to include a deployment script that invokes `gh-pages`. They also updated their `.travis.yml` file to run the deployment script on the `master` branch. This process allows for easy deployment of Gatsby websites to GitHub Pages using Travis CI.