Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(docs): migrate cloud docs to .com #36389

Merged
merged 28 commits into from
Aug 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
9cce498
push up site creation & node version docs
Aug 12, 2022
d4f287b
migrate doc for apex and subdomains
Aug 12, 2022
168a6a9
migrate doc for netlify trailing slash
Aug 12, 2022
383b70d
move webhook/deploy docs to this branch
Aug 15, 2022
c591ee6
migrate doc for outgoing webhooks
Aug 15, 2022
5ab08a8
Merge branch 'gatsbyjs:master' into docs/add-cloud-docs
littlemarcus Aug 15, 2022
f9a2aab
rerun prettier
Aug 16, 2022
25a6914
rerun prettier
Aug 16, 2022
8812501
Merge branch 'gatsbyjs:master' into docs/add-cloud-docs
littlemarcus Aug 16, 2022
3eae690
format subheaders
Aug 17, 2022
5cb2a1f
fix casing in docs descriptions
Aug 18, 2022
9586c04
remove we/lesson refs & netlify doc
Aug 18, 2022
726ed47
Update docs/docs/how-to/cloud/set-node-version.md
littlemarcus Aug 18, 2022
e9c8f16
Update docs/docs/how-to/cloud/create-site-from-repository.md
littlemarcus Aug 18, 2022
675862d
rework create site from repo doc
Aug 19, 2022
ca5f78c
Merge branch 'docs/add-cloud-docs' of https://github.com/MarcusCole51…
Aug 19, 2022
3e4bd91
additional adjustments
Aug 19, 2022
e02f4cf
match description & file title
Aug 19, 2022
526a2e9
adjust VCS references
Aug 19, 2022
3003230
adjust links/bolding
Aug 21, 2022
29b8aa6
final adjustments
Aug 21, 2022
a088fa4
Merge branch 'gatsbyjs:master' into docs/add-cloud-docs
littlemarcus Aug 21, 2022
5c76415
Update docs/docs/how-to/cloud/create-site-from-repository.md
littlemarcus Aug 26, 2022
ecbd430
Update docs/docs/reference/cloud/build-and-preview-webhooks.md
littlemarcus Aug 26, 2022
b444df5
Update docs/docs/how-to/cloud/create-site-from-template.md
littlemarcus Aug 29, 2022
4a96d09
Update docs/docs/how-to/cloud/deploying-to-gatsby-cloud-hosting.md
littlemarcus Aug 29, 2022
14bbb4f
Update docs/docs/how-to/cloud/set-node-version.md
littlemarcus Aug 29, 2022
a45bfe3
Update docs/docs/reference/cloud/apex-and-subdomains.md
littlemarcus Aug 29, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions docs/docs/how-to/cloud/create-site-from-repository.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
title: "Create a Site from a Repository"
description: "Learn how to create a Gatsby Cloud site from a repository"
---

## Introduction

Gatsby Cloud allows you to create a site by importing your Gatsby project from a Git repository. This guide provides the steps for importing a repository from your Git provider and building that site on Gatsby Cloud.

## Prerequisites

You can use the [gatsby-starter-blog](https://github.com/gatsbyjs/gatsby-starter-blog) as a starting point. Select **"Use this template"** to create a new repository using the starter as a template.

![Button to create a new repository from a starter](../../images/use-this-template.png)

## Directions

### 1. Select a Git provider

From your Gatsby Cloud dashboard, click **"Add a Site"**.

![Button to add a site from the Gatsby Cloud dashboard](../../images/add-site.png)

In the "Import from a Git repository" section, choose your Git provider and install the Gatsby Cloud app. For the sake of this article you'll use Github, however GitLab and BitBucket are also supported.

![List of Git Providers](../../images/import-from-repo.png)

### 2. Specify repository details

Once connected to your Git provider, find the repository you would like to add to Gatsby Cloud and click **"Import"**. You can then provide the details for your site:

1. The site name (defaults to `<repo name>-<branch name>`).
1. The branch to import from and set as your "Production branch" in Gatsby Cloud (in this case, the `main` branch).
1. The base directory, i.e., the directory containing the Gatsby site (the root directory, `/`, is default).

![Basic site configuration](../../images/basic-configuration.png)

After you enter the site details, click **"Next"**.

### 3. Add optional integrations

Next, you will be prompted to connect an optional content management system (CMS) to your site. This step will vary depending on the CMS provider, so there are [separate tutorials](https://support.gatsbyjs.com/hc/en-us/articles/1500000746742) for each supported CMS. However, for this specific example, you can scroll past this card to continue on.

![No Supported Integrations Found](../../images/no-integrations.png)

### 4. Configure environment variables

Now, you will be asked to [set up environment variables](/docs/reference/cloud/managing-environment-variables) for your site. The "Default" starter does not use any environment variables so you will skip this step as well. Click **"Build Site"** to continue.

![Section to add environment variables to a new Gatbsy Cloud site](../../images/no-environment-variables.png)

### 5. Finish

Once your site is done building, you can view the site in two places:

#### Private build URL

Use the build URL to preview the deployed site. This URL is not indexed and is only accessible via direct link.

![Gatsby Cloud Private Build URL link](../../images/private-build-link.png)

#### Public default domain

Use your Gatsby Hosting provided "default domain" to access the public deployment of your site. Gatsby Hosting is turned on by default and the "default domain" is listed under "Site Settings > Hosting".

![Gatsby Cloud default hosting domain](../../images/default-domain.png)

### Troubleshooting

When creating a site from a Github repository, you'll be asked to authenticate with Github. In instances where you're having trouble authenticating and importing your site:

1. Log out and log back in. If you are still aren't able to import the site, your Github repository is part of a Github organization, and you are not an owner of that organization, then you may not have sufficient permission to install the Gatsby Cloud app to Github.
1. When you try to import your repository to Gatsby Cloud, an email is sent to the owner(s) of that organization to authorize Gatsby Cloud. Once they authorize via the link in that email, then you will be able to import your repository into Gatsby Cloud.
66 changes: 66 additions & 0 deletions docs/docs/how-to/cloud/create-site-from-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
title: "Create a Site from a Template"
description: "Learn how to create a Gatsby Cloud site from a template"
---

## Introduction

This guide covers how to create a Gatsby Cloud site by cloning a Gatsby starter. Note, cloning of starters is only supported for Github. If you use GitLab or BitBucket, you'll have to follow the [Create a Site from a Repository](/docs/how-to/cloud/create-site-from-repository/) guide instead.

## Directions

### 1. Choose your starter template

From your Gatsby Cloud dashboard, click **"Add a Site"**.

![Button to add a site from the Gatsby Cloud dashboard](../../images/add-site.png)

On the right hand side, click on the card labeled "Gatsby Default Starter".

![Clone Gatsby Default Starter](../../images/default-starter.png)

### 2. Configure your repository

The first time you set up a Gatsby Cloud site, you will need to connect your Gatsby account to Github by clicking on the "Github" icon in the "Create a Git repository" card.

![Create a Git Repository](../../images/create-git-repo.png)

Next, a pop up window should appear and prompt you to install the Gatsby Cloud app to your Github personal account. Click **"Install"**.

![Gatsby Cloud app permissions](../../images/install-gatsby-cloud-app.png)

After the Github app is installed, you will return to Gatsby Cloud. Here you can select a different Github organization to host the repository under as well as change the name of the repository that will be created if you prefer. Then click **"Next"** to create the site.

![Configure Git repository settings](../../images/configure-repository.png)

### 3. Connect integrations

Next, you'll be prompted to connect any integrations. Here is where you can connect your Gatsby Cloud site to your CMS instance. For the purposes of this tutorial, you can select **"Skip this step"**.

![List of available integrations](../../images/connect-integrations.png)

### 4. Set-up summary

After the repository is created, you'll be given the option to configure any necessary environment variables. This step allows you to add both build and preview variables to your site.

![Section to add environment variables](../../images/setup-summary.png)

Next, click **"Create Site"** and you will be taken to the main tab of the Site Overview page for your new site.

![Site Overview screen](../../images/site-overview.png)

### 5. Finish

Once your site is done building, you can view the site in two places:

#### Private build URL

Use the build URL to preview the deployed site. This URL is not indexed and is only accessible via direct link.

![Private Build URL Link](../../images/private-build-link.png)

#### Public default domain

Use your Gatsby Hosting provided "default domain" to access the public deployment of your site. Gatsby Hosting is turned on by default and the "default domain" is listed under "Site Settings > Hosting".

![Default Domain URL link](../../images/default-domain-link.png)
38 changes: 38 additions & 0 deletions docs/docs/how-to/cloud/deploying-to-gatsby-cloud-hosting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
title: "Deploying to Gatsby Cloud Hosting"
description: "Learn how to deploy your site to Gatsby Cloud hosting."
---

In this guide, you'll learn how to deploy your site to Gatsby Cloud Hosting.

## Prerequisites

This tutorial assumes you have already set up a Gatsby Cloud site.

## Enable Gatsby Hosting

In the Gatsby Cloud Site Hosting Settings, select **"Enable Deploys to Gatsby Cloud Hosting"**.

![steps to enable gatsby cloud hosting](../../images/enable-gatsby-cloud-hosting.png)

This will trigger a new Production Build for your site. When that Production Build completes, your site will be ready to view.

### Default domain

You will receive a "default domain" for your site base: `YOUR_SITE_PREFIX.gatsbyjs.io`. This domain has [HTTPS](https://developer.mozilla.org/en-US/docs/Glossary/https) on by default. Visit the `https://<default domain>` URL to see your hosted site.

![default domain in gatsby cloud hosting settings](../../images/hosting-domain-default.png)

### First deploy

Before your first Production Build after turning on Gatsby Hosting completes, you will see the following when you visit your default domain.

![First Deploy Waiting Screen](../../images/first-deploy-page.png)

### Changing your default domain

You can update your default domain by changing the Site Prefix of your Gatsby site in the "General" tab of your "Site Settings".

### Other resources

- See [Adding a Custom Domain](/docs/how-to/cloud/adding-a-custom-domain) for adding a custom domain to your Gatsby Cloud site.
76 changes: 76 additions & 0 deletions docs/docs/how-to/cloud/outgoing-notifications.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
title: "Outgoing Notifications"
description: "Learn how to set outgoing notifications based on your build and deploy status"
---

When your Gatsby site is built and deployed on Gatsby Cloud, you now have the option to hook up a set of outgoing notifications regarding the status of that build. You can send notifications via:

1. A generic webhook.
1. A webhook that sends a Slack message.
1. Pull Request comments in Github or GitLab.

By default, the Pull Request comments are already set up for existing and new sites in Gatsby Cloud.

### Adding webhook notifications

1. First, navigate to "Site Settings". In the sidebar menu under "General", select **"Outgoing Notifications"**. Then click **"Add Notification"** and choose the "Webhooks" option.

![Steps to add a webhook notification](../../images/webhook-notification.png)

2. Next, you will be prompted to add a webhook that will receive the payload of information about your build or deploy. There are the following options for event notifications:

- build succeeded
- build failed
- build timed out
- preview succeeded
- preview failed
- preview timed out
- deploy succeeded
- deploy failed

3. Paste your webhook into the "Outgoing webhook URL" field, choose an event to listen to, then click **Save**. If you want to trigger notifications for multiple events, add a new notification for each.

![Button to add a notification](../../images/add-notification.png)

#### Webhook message payload

You can expect the message payload to appear as following:

```json
{
"body": "Markdown message similar to PR comment",
"buildId": "string-id-of-your-build",
"workspaceName": "your-workspace-name",
"siteName": "your-project-name",
"deployPreviewUrl": "https://your-project.staging-previews.gtsb.io",
"logsUrl": "https://staging.gtsb.io/dashboard/{workspace-id}/sites/{site-id}/builds/{build-id}/details",
"duration": "time-of-build",
"resourceId": "UUID of resource",
"resourceType": "SITE",
"event": "BUILD_SUCCEEDED"
}
```

### Adding slack notifications

To take advantage of Slack notifications, you first need to create a custom Slack application to handle the webhook message.

1. First, [add a new Slack app](https://api.slack.com/apps?new_app=1). Add one for a workspace where you have [appropriate permissions](https://slack.com/help/articles/201314026-Permissions-by-role-in-Slack#apps-integrations).

![Modal to create a slack app](../../images/create-slack-app.png)

2. Next, add the "Incoming Webhook" feature and activate it. Then, at the bottom of that page, click **"Add New Webhook to Workspace"**:

![Slack Incoming Webhooks feature](../../images/incoming-webhook.png)

3. Now, select an appropriate channel for your notifications and click **"Allow":**

![Slack App Permissions](../../images/slack-app-permissoin.png)

After that, you will see a success message and a new webhook URL will be generated. Copy the "Webhook URL".

![Example of a Webhook URL](../../images/webhook-url.png)

4. Finally, return to Gatsby Cloud and navigate to the "Outgoing notifications" settings. Click **"Add Notification"** and choose the "Slack" option. Paste the Slack application's webhook URL that you previously copied into the "Outgoing webhook URL" field.

5. Choose which Event to listen to and then click **"Save"**. You can reuse the same Slack application webhook for all four event types. If you want to send a notification to multiple channels, you must generate additional Webhook URLs for your Slack app and create additional notifications as described above.
25 changes: 25 additions & 0 deletions docs/docs/how-to/cloud/set-node-version.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
title: "Set a Node.js Version for Your Site"
description: "Learn how to set a Node version for your Gatsby Cloud site."
---

## Introduction

You can specify a Node.js version for site in Gatsby Cloud in two different ways, by environment variable or `.nvmrc` file. If you don't set a Node version, Gatsby cloud will use the following defaults:

- The default Node.js version is 14.
- If you are using npm 7, the default is 16.

### Environment variable

You can set your Node.js version using the `NODE_VERSION` environment variable inside Gatsby Cloud. Read more about [setting environment variables](/docs/reference/cloud/managing-environment-variables).

### Using nvm

You can include a `.nvmrc` file in your project repository, and Gatsby Cloud will read the Node version from that file.

Example format:

```javascript:title=.nvmrc
v14.19.0
```
Binary file added docs/docs/images/add-a-site.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/images/add-notification.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/images/add-site.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/images/add-webhook-to-workspace.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/images/basic-configuration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/images/cloud-cms-webhook.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/images/cloud-webhook-image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/images/cloud-webhooks-settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/images/configure-repository.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/images/connect-integrations.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/images/create-git-repo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/images/create-slack-app.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/images/default-domain-link.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/images/default-domain.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/images/default-starter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/images/enable-gatsby-cloud-hosting.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/images/first-deploy-page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/images/gatsby-domain-redirect.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/images/hosting-domain-default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/images/import-from-repo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/images/incoming-webhook.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/images/install-gatsby-cloud-app.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/images/make-primary.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/images/no-environment-variables.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/docs/images/no-integrations.png
Binary file added docs/docs/images/notification-list.png
Binary file added docs/docs/images/primary-domain.png
Binary file added docs/docs/images/private-build-link.png
Binary file added docs/docs/images/remove-from-redirect.png
Binary file added docs/docs/images/setup-summary.png
Binary file added docs/docs/images/site-overview.png
Binary file added docs/docs/images/slack-app-permissoin.png
Binary file added docs/docs/images/use-this-template.png
Binary file added docs/docs/images/webhook-notification.png
Binary file added docs/docs/images/webhook-url.png
43 changes: 43 additions & 0 deletions docs/docs/reference/cloud/apex-and-subdomains.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
title: "Apex and Subdomains"
description: "Learn how to configure your apex and subdomains in Gatsby Cloud"
---

## Introduction

Adding a custom domain to your Gatsby Cloud site will add both the [apex domain](https://datacadamia.com/network/name/apex#about) and "www" subdomain. This guide will show you how to configure these domains, and redirect between the two.

### Adding the domain

1. Add either an apex domain or `www` subdomain to your Gatsby Hosting configuration. You can read more about adding a domain in [Adding a Custom Domain](/docs/how-to/cloud/adding-a-custom-domain/).

2. You should see a redirect pair of domains with the domain you entered as a "Primary domain".

![List of connected domains](../../images/primary-domain.png)

3. Follow the directions for adding [DNS records](https://www.cloudflare.com/learning/dns/dns-records/) for both of the domains that are listed. The apex domain will need an A record pointed to an IP address and the subdomain will need a CNAME pointed at your Gatsby Hosting default URL, `YOUR_SITE_PREFIX`.

### Switching the redirect

If you want the redirected domain to be the primary domain, click the **"Make Primary"** button on the right-hand side of the domain listing.

![Button to change primary domain](../../images/make-primary.png)

### Removing a domain from a redirect

To remove a domain from the redirect, click **"Remove"** on the right-hand side of the domain listing. The remaining domain will act as a non-redirected domain, regardless of whether it was the primary domain.

![Button to remove a domain from a redirect](../../images/remove-from-redirect.png)

If you re-add the domain you just removed, both domains will act as primary domains without a redirect. If you need to re-add the redirect, remove both domains and start over.

### Adding the gatsbyjs.io domain to a redirect

Gatsby Cloud now allows you to redirect your `gatsbyjs.io` domain to your primary domain. This ensures that search engines don't index the `gatsbyjs.io` domain. To do this:

1. Next to where your `gatsbyjs.io` domain is listed, click **"Select Primary Redirect"**.
1. Select a Primary domain:

![Gatsby Domain Redirect](../../images/gatsby-domain-redirect.png)

All `gatsbyjs.io` domains will 301 redirect to the primary domain that you select. A 301, or permanent, redirect is when the server signals to the browser that this page has been permanently moved to another location.
49 changes: 49 additions & 0 deletions docs/docs/reference/cloud/build-and-preview-webhooks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
title: "Build and Preview Webhooks"
description: "Learn about Gatsby's Build and Preview webhooks and their differences"
---

In this guide, you'll learn the differences between Build and Preview webhooks, and how each interacts with your Gatsby Cloud site.

## Using webhooks

For every site, Gatsby Cloud provides two webhooks:

A Build Webhook which triggers a Production Build,
and a Preview Webhook which triggers a CMS Preview build.
These webhooks can be found by going to "Site Settings" then selecting **"General > Webhook"** in the sidebar menu.

![webhook settings on the gatsby cloud dashboard](../../images/cloud-webhooks-settings.png)

When you connect a content management system (CMS) to your site (manually or via Quick Connect), it uses these webhooks to trigger your builds.

You can use any tool (Postman, Zapier, etc.) to send a `POST` request to either of the webhooks. For example, here's the structure for a `curl` request to some site's Preview Webhook:

```shell
curl -X POST https://webhook.gatsbyjs.com/hooks/data_source/<site id>
```

## How do you know a webhook worked?

You can tell when a build is triggered via webhook by inspecting the build card. For example, a build triggered via the Build Webhook will say "Triggered by Gatsby Build Webhook."

![image of webhook build in the gatsby cloud dashboard](../../images/cloud-webhook-image.png)

However, if the build is triggered by one of the officially supported CMSs, the build card will indicate the name of the CMS that triggered it.

![webhook triggered from CMS integration](../../images/cloud-cms-webhook.png)

## Specifying a data source

You can use the `x-gatsby-cloud-data-source` HTTP header to specify the data source you want to refresh. For example, if your source plugin is called `gatsby-source-awesome` then you want to send `"x-gatsby-cloud-data-source": "gatsby-source-awesome"` as a header value in the webhook.

Note: The `x-gatsby-cloud-data-source` header value must include "gatsby-source" in the name for it to be considered a valid source.

## Clearing the cache

If you need to trigger a cache clear before you build, you can do this by making a `POST` request to `https://webhook.gatsbyjs.com/hooks/builds/trigger/:siteId` with the header `x-gatsby-cache: false`, which will trigger a build with no cache. If you want to use this for previews, add an additional header: `x-runner-type: PREVIEW`.
Using `curl`, the request would look like this for clearing cache on a build:

```shell
curl -X POST https://webhook.gatsbyjs.com/hooks/builds/trigger/<site id> --header "x-gatsby-cache: false"
```