Deploying a static site to Github Pages using Travis and Cloudflare
A quick and easy way to use these 3rd party services to deliver your site:
- Cloudflare speeds up your site and gives you HTTPS for free.
- Github Pages is basically zero-configuration, free hosting.
- Travis CI glues the pieces together. And it’s free.
The setup for this site
- the source for this static site is on the
sourcebranch of the repo
- when I push to that branch, Travis CI builds the static site, then pushes that built site to the
masterbranch of the repo
- Github pages is configured to serve the
masterbranch as static files at http://goodgravy.github.io/
- Cloudflare acts as a CDN in front of Github pages, serving as https://jmsbrdy.com/
Travis CI configuration
Full file here, relevant excerpt here:
Following this guide should get you basically there.
after_deploy step purges the entire Cloudflare cache for your site, so feel free to be very aggressive with the caching settings.