The easiest way to deploy a Gatsby website to production is to use Gatsby Cloud from the Gatsby team. Gatsby Cloud is a platform that gives your Gatsby website superpowers! With intelligent caching and incremental builds, Gatsby Cloud takes the speed and performance of your Gatsby website to another level.
This tutorial will guide you on how to deploy a Gatsby website to Gatsby Cloud from a Git Repository.
Before you start
Learn how to Set Up your Gatsby Development Environment
Head to the Gatsby website and create or log in to your account using GitHub or GitLab.
Once you're in you can add a new site by importing from a Git repository or starting from a template. I'll be importing from a Git repository.
After you select your Git provider, select a Github organization and repository.
Next, you want to make sure you add your Build and Preview variables and hit save.
You can find the Keys needed for your environment variables in Agility under Settings > API Keys.
Build Variables:
AGILITY_API_ISPREVIEW = false
AGILITY_API_KEY = LIVE API KEY
AGILITY_GUID = INSTANCE GUID
Preview Variables:
AGILITY_API_ISPREVIEW = true
AGILITY_API_KEY = PREVIEW API KEY
AGILITY_GUID = INSTANCE GUID
The next time you make a commit, gatsby will build a production deployment for you! You can also trigger a new build straight from within Gatsby Cloud.
Comments
Please sign in to leave a comment.