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

Jason Lengstorf
InstructorJason Lengstorf
Share this video with your friends

Social Share Links

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.

egghead
egghead
~ 2 minutes ago

Member comments are a way for members to communicate, interact, and ask questions about a lesson.

The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io

Be on-Topic

Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.

Avoid meta-discussion

  • This was great!
  • This was horrible!
  • I didn't like this because it didn't match my skill level.
  • +1 It will likely be deleted as spam.

Code Problems?

Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context

Details and Context

Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!

Markdown supported.
Become a member to join the discussionEnroll Today