Deploying your Gatsby Site to Netlify

This guide will cover how you can deploy your Gatsby and Agility CMS starter using our Automated Netlify Deployment.

Deploying to Netlify

Setting Up Preview

Rebuilding Your Site with Webhooks

Deploying To Netlify

Note

You will need to have a GitHub and a Netlify account to get your project deployed.

To start, head by going into Settings > Sitemaps, then click Setup Deployment.

Screen_Shot_2021-03-11_at_12.57.25_PM.png

Select the Netlify Automated Deployment.

Screen_Shot_2021-07-19_at_11.47.15_AM.png

Allow Netlify to connect with your Github account.

Screen_Shot_2021-07-29_at_11.49.54_AM.png

Next, Netlify will create a repository in your GitHub account with the name you choose. When you're ready, click on Save & Deploy.

Screen_Shot_2021-07-29_at_11.50.38_AM.png

Once complete, Netlify will deploy a copy of the Agility CMS & Gatsby Starter Template on a unique domain.

Screen_Shot_2021-07-29_at_12.14.50_PM.png

Setting Up Production Domain

To set up your Production Domain in Agility, copy the Deployment URL Netlify generated for you upon deploying your site. Set up a deployment in Agility by going to Settings > Sitemaps and click on the Setup Deployment button. From there, select a Custom Deployment.

Enter your deployment details and click Save.

Screen_Shot_2021-07-29_at_12.16.18_PM.png

Your Production Domain will then be configured.

Screen_Shot_2021-07-29_at_12.16.52_PM.png

Setting Up Preview

When setting up a Preview Environment for Gatsby, we recommend using the Gatsby Cloud platform, specifically created for the Gatsby framework.

Setting up Gatsby Cloud

Rebuilding Your Site with Webhooks

You can rebuild your Gatsby site deployed on Netlify with Webhooks. In Netlify, go to Site Settings > Build & Deploy > Build Hooks to create a new webhook. Give your webhook a name a select a branch you would like to rebuild. Click Save and copy the URL Netlify generates for you.

Screen_Shot_2021-07-19_at_5.41.46_PM.png

In Agility, go to Settings > Web Hooks to add a new webhook. Give your Webhook a name and paste in the URL.

  • For Production builds, make sure Receive Content Publish Events is checked off.
  • For Preview builds, uncheck Receive Content Publish Events, and check off Receive Content Save Events.

You can test the Webhook by sending a test payload.

Screen_Shot_2021-05-27_at_12.05.13_PM.png

3 out of 3 found this helpful

Comments

0 comments

Please sign in to leave a comment.