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 1 commit
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
Next Next commit
push up site creation & node version docs
  • Loading branch information
“Marcus committed Aug 12, 2022
commit 9cce4983dde580cb9ada38c9aa702a34672a9d32
86 changes: 86 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,86 @@
---
title: "Create a Site from a Repository"
description: "How to create a Gatsby Cloud Site From a Repository"
littlemarcus marked this conversation as resolved.
Show resolved Hide resolved
---

## Introduction

There are two workflows for adding a new Gatsby Cloud site:
littlemarcus marked this conversation as resolved.
Show resolved Hide resolved

- Cloning a Starter.
- Importing from a Git Repository.

This lesson covers the "Import from a Git Repository" flow.
littlemarcus marked this conversation as resolved.
Show resolved Hide resolved

### 1. Prepare a Repository

For this lesson we will use the [gatsby-starter-blog](https://github.com/gatsbyjs/gatsby-starter-blog). Since this is a [Gatsby starter](https://www.gatsbyjs.com/starters/?v=2), you can use Gatsby CLI to prepare this project on your machine.
littlemarcus marked this conversation as resolved.
Show resolved Hide resolved

```shell
gatsby new my-gatsby-project https://github.com/gatsbyjs/gatsby-starter-blog
```

Alternatively, you can clone the repository using Git.

```shell
git clone https://github.com/gatsbyjs/gatsby-starter-blog
```

After you have the project, push it to your remote GitHub repository.

### 2. Select a Git Provider

From your Gatsby Cloud Dashboard, click the **Add a Site** button.
littlemarcus marked this conversation as resolved.
Show resolved Hide resolved

![Add a Site](../../images//add-site.png)
littlemarcus marked this conversation as resolved.
Show resolved Hide resolved

In the "Import from a Git repository" section, choose your Git provider and install the Gatsby Cloud app. For the sake of this article we'll use GitHub, however GitLab and Bitbucket are also supported.
littlemarcus marked this conversation as resolved.
Show resolved Hide resolved

![Import from a Repository](../../images/import-from-repo.png)

### 3. 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>`).
2. The branch to import from and set as your "production" branch in Gatsby Cloud (in this case, the `main` branch).
3. The base directory, i.e., the directory containing the Gatsby site (the root directory, `/`, is default).
littlemarcus marked this conversation as resolved.
Show resolved Hide resolved

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

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

### 4. 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)

### 5. Configure Environment Variables

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

![No Environment Variables](../../images/no-environment-variables.png)

### 6. 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](../../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.
2. When you try to import your repository to Gatsby Cloud, we send an email 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.
69 changes: 69 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,69 @@
---
title: "Create a Site from a Template"
description: "How to Create a Gatsby Cloud Site from a Template"
---

## Introduction

There are two workflows for adding a new Gatsby Cloud site:
littlemarcus marked this conversation as resolved.
Show resolved Hide resolved

- Clone a Starter
- Import from a Git Repository

In this lesson, we'll use the "Clone a Starter" flow. Note, cloning of starters is only supported for GitHub. If you use GitLab or BitBucket, you have to follow the [Create a Site from a Repository](/docs/how-to/cloud/create-site-from-repository/) lesson instead.

### 1. Choose Your Starter Template

From your Gatsby Cloud Dashboard, click the **Add a Site** button.

![Add a site](../../images/add-site.png)

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

![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**.

![Install Gatsby Cloud App](../../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](../../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**.

![Connect 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.

![Setup Summary](../../images/setup-summary.png)

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

![Site Overview](../../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)
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: "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:
littlemarcus marked this conversation as resolved.
Show resolved Hide resolved

- 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 [here](../../reference/cloud/managing-environment-variables).
littlemarcus marked this conversation as resolved.
Show resolved Hide resolved

### 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-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/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/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/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/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/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/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
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/private-build-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/setup-summary.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/site-overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.