Update June 2020: I am no longer using this infrastructure for my site. See Deploying a Gatsby site to GitHub Pages using Actions and Cloudflare.
A quick and easy way to use these 3rd party services to deliver your site:
source
branch of the repomaster
branch of the repomaster
branch as static files at http://goodgravy.github.io/Full file here, relevant excerpt here:
deploy:
local_dir: public
provider: pages
skip_cleanup: true
target_branch: master
fqdn: 'jmsbrdy.com'
github_token: $GITHUB_TOKEN # Set in travis-ci.org dashboard
on:
branch: source
after_deploy:
- |
curl -X DELETE "https://api.cloudflare.com/client/v4/zones/${CF_ZONE_ID}/purge_cache" \
-H "X-Auth-Email: ${CF_EMAIL}" \
-H "X-Auth-Key: ${CF_API_KEY}" \
-H "Content-Type: application/json" \
--data '{"purge_everything":true}'
Following this guide should get you basically there.
The after_deploy
step purges the entire Cloudflare cache for your site, so feel free to be very aggressive with the caching settings.