Deploying your site
Deploying your site
The Gatsby documentation explains in details the deployment process. You will find there a variety of possibilities.
You should definitely consider deploying on Gatsby Cloud, the cloud platform specifically built by Gatsby for the Gatsby framework.
In both cases you need to have a remote repository for your project. Your repository can be private or public. We'll use GitHub here.
✅ Given that our starters require
yarnto work, make sure to have
yarn.lockin your starter's GitHub repository. The
yarn.lockfile is automatically added when you first install your dependencies with the
Sign-up to Gatsby Cloud with your GitHub account.
Click the Add a site + button on your Dashboard.
Choose the Import from a Git repository option
Select your Git provider, GitHub in our case. Then selecto the starter's repository.
You will have to authorize Gatsby Cloud to access your respository. (You can always modify the configuration in your GitHub Settings Installations)
Skip the integration step
Gatsby Cloud list the environmental variables that were automatically detected. Make sure to fill in the the value for the required
GATSBY_WP_URL. You also have to provide your secret auth token
- Sign-up to Netlify with your GitHub account.
- Click the New Site from Git button
- Choose your Git provider, GitHub in our case.
- Choose your GitHub repo (you will need authorize Netlify to access it).
- In the configuration screen, choose:
- your branch to deploy - each time you push to this branch, your site will be rebuilt
- the build command:
- your publish directory:
- open the Advanced build settings panel to add your environment variables. Paste all the variables you set in your
.envfile as well as the secret auth token
Your build requires two environment variables
- Click the Deploy site button, the process can take a few minutes.
- Finally in Site settings > Domain management you can change the subdomain (by default it's some random string like modes-gates-51b250). You can also add your own custom.