Gatsby Cloud is a performant platform for building your Gatsby site. Even better, it integrates with Content Delivery Networks (CDNs) like Google Cloud Storage so you can build and deploy your site seamlessly.
This guide assumes you already:
- have a Google Cloud Storage account
- have a Gatsby Cloud site created
You can use either of the following site creation options if you don't have one already:
Setting Up a Hosting Integration
Once your site is available inside Gatsby Cloud you can “view details” and navigate to the “Site Settings” tab.
Inside Site Settings there is an “Integrations” link. Select this menu item and scroll down to the section titled “Hosting Integrations”.
This is where you’ll see the Google Cloud Storage logo. Click the “Connect” button to the right of that logo and you’ll be prompted to enter information about your Google Cloud Storage project.
You’ll be prompted to fill in some information:
- Project ID
- Service Account Key (JSON format, requires Storage Object Admin role)
- Bucket Name
- File Key Prefix (optional)
If you haven’t already, you’ll need to create a new project, service account, and service account key from your project settings. You can create a new bucket from the Google Cloud Storage Browser.
And that’s it! Your site is now set up to build and deploy. Gatsby Cloud will handle everything for you. However, if you want to make a change to your domain you’ll want to do that directly on the Google Cloud Storage dashboard.
Note that you can only have one hosting integration. If you choose to configure another provider, that will override your existing Google Cloud Storage integration.