This repository is a working example/template for integrating CircleCI into your Netlify continuous integration flow. The general strategy is outlined in the Netlify community post advising how to Test your Netlify Builds. The applicable section is “Acceptance Testing”.
This is a fork of https://github.com/danurbanowicz/jekyll-netlify-boilerplate -- A really simple Jekyll template for creating a fast, static website on Netlify with a continuous deployment workflow.
Standard Netlify CMS workflow works like this:
*.netlify.com
URL. Note that the status (Draft / In Review / Ready) on a post or page in the CMS GUI only updates the in-CMS workflow. There is no change propagated to github.Given the requirement that some sort of automated tests pass prior to publication -- this template raises errors if HTML is malformed or dead links are present -- we need to disable the default netlify Auto-Deploy behavior and instead let CircleCI push the build if and only if the tests pass:
https://app.netlify.com/sites/(your-site-slug)/deploys
-- None of the magic herein can override that ability. Presumably your content creators do not have access to this interface. :-)https://app.netlify.com/sites/(your-site-slug)/settings/deploys
.Configure your github repository with a Branch Protection Rule ( Your Repo >> Settings >> Branches >> Branch protection rules ). Peer reviews are a good thing, and CircleCI will still deploy your site to Netlify using the scheme described herein -- when the tests pass post-merge. Note that the protected branch should be the "production branch" specified in Netlify, which is master by default.
Notes from @danurbanowicz:
_redirects
and _headers
files ready to useBased on Netlify's Jekyll + Netlify CMS starter template, head over there for more details on deployment and build settings or to get help with setting up Netlify.
For help with templates, local development and other Jekyll related stuff, check out the excellent Jekyll Docs.
You can test the demo site's TTFB (Time To First Byte) at testmysite.io
Use this deploy button to get your own copy of the repository deployed to Netlify:
This will setup everything needed for running the CMS:
After deploying this project, Netlify Identity will add you as a CMS user and will email you an invite. It is not necessary to accept this invite if you wish to use an OAuth provider (e.g. Github) to manage authentication for your CMS. It is recommended to use this method of authentication as it removes the need for an email & password to log in to the CMS and is generally more secure. You will need to add an OAuth provider in your Netlify app settings under "Settings" > "Identity" > "External providers".
Next, navigate to /admin
on your site, choose your OAuth provider from the
login box and you should then be logged into your CMS.
Now you're all set, and you can start editing content!
Note: if you switch the repo that was created to private, you'll need to regenerate your token, as the token generated using the deploy to Netlify button can only access public repositories. To regenerate your token, head to "Settings" in your Netlify site dashboard, go to the "Identity" section, then scroll to "Services" where you'll see an "Edit settings" button. Click that and you'll see a text link to "Generate access token in GitHub".
Clone this repository and run:
bundle install
bundle exec jekyll server --watch
Jekyll will watch your project folder for changes.
Now navigate to localhost:4000 to preview the site, and localhost:4000/admin to log into the CMS.
This is a living project. Report an issue or submit a PR.
If you need any help with setting up Netlify CMS, you can reach out to the Netlify team in the Netlify CMS Gitter.