Set up a GitHub repository for automatic deploys using Netlify’s CLI

Jason Lengstorf
InstructorJason Lengstorf

Share this video with your friends

Send Tweet
Published 4 years ago
Updated 3 years ago

Set up a site project to automatically deploy to production whenever new changes are pushed to GitHub using Netlify.

Jason Lengstorf: [0:00] To set up a site with Netlify so that it will autodeploy any time we push to Git, we need to have a Git repository set up.

[0:07] I have set up a remove for this repo at stripe-checkout-netlify-serverless and I've set that up as my origin. Now I can git push origin master, and that will push up all the changes to GitHub. If I look at this, we can see that the changes are there.

[0:29] Next, I can run ntl init. What ntl init does, is it talks to netlify and it asks us what we want to do. I want to Create & configure a new site. I want it to go into my personal sites. I'm going to give it the same name as our repo, so stripe-checkout-netlify-serverless.

[0:55] Our build command, we don't have one, so we're going to set init to skip. We're going to deploy the public directory, because we want those at that index.html file to be our root.

[1:07] Once that is finished, it will have created the site for us. Now I can run ntl open. We can look at the site. It shows that deploy is already in progress. If we click in here, we can see the build running, and that the site is now live.

[1:28] If I come back out here and click over, we can see our products are now live on the Internet at our netlify domain. Any time we push any changes, it will automatically redeploy whatever changes we pushed to the master branch on GitHub.