— Code — 1 min read
After enjoying the full Netlify ecosystem for the past year, I've come up against their recent changes in build times for free accounts.
Given the recent progression of Github Actions to broader release, I figured I'd give it a shot to move builds back to Github but maintain support for Netlify CMS as a GUI for editing site content.
This ended up being quite the hassle.
So, I've documented the final fix below. Example commit.
CNAMEto your repo with your domain (ie.
1$ gco -b gh-pages2$ git push --set-upstream origin gh-pages
Update domain registrar (ie. Namecheap) with the following new DNS records to point at Github Pages instead of Netlify. Note, use subdomain instead of
www below if it is a subdomain.
1A @ 188.8.131.52 TTL(Auto)2A @ 184.108.40.206 TTL(Auto)3A @ 220.127.116.11 TTL(Auto)4A @ 18.104.22.168 TTL(Auto)5CNAME www username.github.io. TTL(Auto)
Update the configuration of Netlify CMS in the repo.
1backend:2 name: git-gateway3 branch: master
1backend:2 name: github3 repo: adrw/cook4 site_domain: cook.alexanders.xyz5 branch: master
Deploys, stop auto-publishing to prevent the site instance from contributing to your monthly build minutes.
Settings/Build & Deploy, in
Deploy contexts, turn off deploy previews.
Settings/Access Control, add Github as an OAuth authentication provider. You'll need to set up a new OAuth app in Github settings to get the secret values. Use
https://api.netlify.com/auth/doneas the success url.
Settings/Domain management, add the value you used for
static/admin/config.ymlas a custom domain. This will allow Netlify's redirect after auth to correctly redirect to the correct domain.