I love how easy it is to set up automatic hosting of a website with Netlify.
Sign in to Netlify and click the "New site from Git" button. Select your git repository, either GitHub, GitLab or Bitbucket, and give access to the wanted repository.
If you have build commands, such as
npm run build, you can enter those. Commands can be chained with &&.
Enter the path of the directory to publish. The directory containing the index.html file
Now hit Deploy site and you are done. New pushes to your git repository will automatically be published to your website. You can change your subdomain in "Site settings" and "Change site name".
Terminal commands you don't need, but might find useful:
# Install netlify cli globally npm install netlify-cli -g # Serving your site on localhost netlify dev # Connect folder to Netlify project netlify init # Serve your local development online ang get a url you can distribute netlify dev --live # Manually deploy netlify deploy --prod
That's all, thank you for reading 💙
This article is part of Hosting a Website series, I usually choose Firebase when I want to deploy manually or are using other Firebase products and Netlify if I want CD (continuous delivery). Though both manually and CD is possible to achieve with both of them.