Deploying your Gatsby Site to Netlify

An excellent solution to deploy a Gatsby website to production is to use Netlify. Netlify is a web hosting platform that offers cloud hosting and serverless backends for static websites.

This tutorial will guide you on how to deploy a Gatsby website to Netlify from a Git Repository.

Before you start

Learn how to Set Up your Gatsby Development Environment

Head to the Netlify website and create or log in to your account.

Screen_Shot_2021-01-06_at_2.24.13_PM.png

Once you're logged in you can add a new site by importing from a Git repository.

Screen_Shot_2021-01-06_at_2.26.11_PM.png

Connect to your Git provider.

Screen_Shot_2021-01-06_at_2.41.22_PM.png

Search for and select the Git repository of the website you wish to host.

Screen_Shot_2021-01-06_at_2.46.23_PM.png

Once you've selected your Git repository, fill out your build settings. Be sure to click "Advanced Settings" to include the environment variables needed for your Gatsby production build.

You can find the Keys needed for your environment variable under Settings > API Keys:

Screen_Shot_2021-03-01_at_4.32.59_PM.png

Build Variables:

AGILITY_API_ISPREVIEW = false
AGILITY_API_KEY = LIVE API KEY
AGILITY_GUID = INSTANCE GUID

When you're done, click deploy!

Screen_Shot_2021-01-06_at_3.11.04_PM.png

When your deployment is done, Netlify will provide you with a temporary deployment URL. A custom domain can be added to your site by navigating into the Domain settings.

Screen_Shot_2021-01-06_at_3.26.06_PM.png

Updating your Gatsby site when Content Changes

Since Gatsby is a Statically Generated Site, you'll need to rebuild the site in order to see the updated content when content has changed in Agility.

Rebuild your Gatsby site with Webhooks

3 out of 3 found this helpful

Comments

0 comments

Please sign in to leave a comment.