Skip to main content

Deploy a Gatsby site

Sitecloud is mainly a hosting service, we want to enable all kind of users to deploy to the web. In order to do that we embrace the JAMStack and hosts static websites built on frameworks like Gatsby.

Install first the Sitecloud CLI on your machine and connect to your account:

npm i -g @sitecloud/cli
sc login

Now you can list all your available static sites with the next command:

sc sites ls

Obviously you don't have any project yet. Go now to your Gatsby project directory and build it as usual:

yarn build

Gatsby will build your website. Now it is time to publish it on Sitecloud, create a YAML file named sitecloud.yml and with this content:

name: my-gatsby-project
build: ./public

That will tell Sitecloud CLI where the built is located and the name of your project. Now execute this to publish to Sitecloud:

sc sites publish

After succesfully finishing the process, your project will show up in the Sitecloud dashboard or you can also list it using the CLI:

➜ sc sites ls
✔ Listing sites:
my-gatsby-project (https://my-gatsby-project-b1a724d9.static.sitecloud.net)

Notice that a dynamic URL has been created for your project, this URL won't change and you can use it to link to your DNS service.