Deploy a Gatsby website on Netlify

Khaled Garbaya
InstructorKhaled Garbaya

Share this video with your friends

Send Tweet
Published 3 years ago
Updated a year ago

In this lesson, you will learn how to push your website code to Github and Build and deploy it using Netlify

Instructor: [00:00] In GitHub, let's create a new repository. Here, we will name it JAMstack tutorials. We can create the repository. Now, let's follow these instructions. Mainly, we'll add this remote.

[00:30] Go to the command line. Here, we will paste this. Hit enter. Now that we have the remote added, let's add everything and commit. Now, let's push.

[00:51] Let's go back to our repository. Refresh. Now, we have all the code in here committed. Let's go to Netlify. After you log in, this is your main dashboard. You click new site from Git. Here we click GitHub.

[01:15] After I am authorized, I can look for the repository that they have. If we type just JAMstack, it will be more than enough.

[01:29] This is our repository. You can see here that it's a Gatsby project. It will run this Gatsby build command from my server. Let's deploy the site. You can see the logs. This is our website being built.

[01:55] Now, our site is live. We can click on the preview button. You can see here this is our website. We can navigate and go to the lessons and read everything. That's how you deploy your Gatsby website to Netlify.

Joel
Joel
~ 2 years ago

This is very confusing... just following the instructions of the pre-req does not work. In what repository is this code at? Then linked GitHub repo is the finished project? What about the initial code? When are you installing Gatsby? When are you installing the Contentful packages? Is this an actual repo where I pull the starter files or am I supposed to watch a previous course this is a continuation of... The assets used in this tutorial.. where do I get them? Im not a professional dev... just trying to learn... but also not super beginner.

Khaled Garbaya
Khaled Garbayainstructor
~ 2 years ago

Hi Joel, This lesson is part of a course where we build up to this stage. In lesson 2 i cover how you can install the dependencies you need.

Let me know if you need further help

Khaled

Joel
Joel
~ 2 years ago

Ok I see.. thank you ...

A.C.
A.C.
~ 2 years ago

Hi Khaled, is it a good practice to store the contentful keys directly in the repo? If not, what would be the best practice?

Khaled Garbaya
Khaled Garbayainstructor
~ 2 years ago

Hey there, a best practice would be setting the key as an Environment Variable in Netlify