How to Deploy your Static Site to Netlify

There are various ways to deploy and host static sites after you design them on your local machine. A static site is a website built with plain HTML, Javascript, or CSS code.
Netlify is an easy way to deploy and host static web projects without buying …


This content originally appeared on DEV Community and was authored by Victor Oluwayemi

There are various ways to deploy and host static sites after you design them on your local machine. A static site is a website built with plain HTML, Javascript, or CSS code.
Netlify is an easy way to deploy and host static web projects without buying a domain name and hosting. Netlify does everything for you.

Getting Started

In this article, you will learn how simple it is to launch your static site on Netlify. You need an account to deploy on Netlify. You will deploy a static site designed with HTML/CSS; check out the Netlify documentation to integrate other frameworks like React.js/Next.js.

Prerequisites

To follow the instructions in each section, you'll need the following setup:

  • A code editor such as VScode.
  • Git is installed on your system.
  • An account with a Git provider (GitHub/Bitbucket/Gitlab). GitHub will be used in this article.
  • Ensure Node.js is installed. To check if Node and npm are installed, type this code in your terminal:
node -v //press enter
//v16.13.1
npm -v //press enter
//8.3.0

Deploy to Netlify using Github

To create a repository on GitHub, open a terminal in VScode and run each command line by line, and press enter. A git provider like Github connects your project to enable Netlify to allow continuous deployment; anytime you make changes to your project and push to GitHub, Netlify automatically redeploys your site, and the changes you make are visible.

echo "# My app" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/{your_username}/{your_repository_name}.git
git push -u origin main

Check your repository on GitHub, and you should have something like this.
Github repository

Create an account on Netlify and log in to your Netlify Dashboard.
Netlify homepage

Switch to the Sites tab, click the Add New Site dropdown and connect to your GitHub repository.
Connect to Github repository

You will be prompted to authorize Netlify to access your GitHub repositories; if you can’t find the search for a specific repository, select Configure the Netlify app on GitHub.
Pick a repository

Then, scroll to the bottom of the page and either grant Netlify access to all your repositories or select a particular repository.
Select a repository on Github

Finally, select the repository and click deploy.
Deploy

Your browser will then redirect you to the Site overview page, where you can look for the deployment in the list of Production deploys. Select the link to open your deployed site.
Site overview page

Deploy to Netlify using Drag and Drop

Login to your Netlify Dashboard, switch to the Sites tab, and click the Add New Site dropdown. Select Deploy manually or browse to upload.
Netlify Drag and Drop

Drag and drop your project folder and wait for it to be published.

Conclusion

In this tutorial, you learned how to use Netlify to deploy your project(HTML/CSS) online using Github and Manual Deploys.
You can connect a custom domain name to your site, connect the forms to Netlify for easy management, or check the documentation to explore more features.

That’s all for now. Happy Coding!

Resources


This content originally appeared on DEV Community and was authored by Victor Oluwayemi


Print Share Comment Cite Upload Translate Updates
APA

Victor Oluwayemi | Sciencx (2023-03-13T21:24:59+00:00) How to Deploy your Static Site to Netlify. Retrieved from https://www.scien.cx/2023/03/13/how-to-deploy-your-static-site-to-netlify/

MLA
" » How to Deploy your Static Site to Netlify." Victor Oluwayemi | Sciencx - Monday March 13, 2023, https://www.scien.cx/2023/03/13/how-to-deploy-your-static-site-to-netlify/
HARVARD
Victor Oluwayemi | Sciencx Monday March 13, 2023 » How to Deploy your Static Site to Netlify., viewed ,<https://www.scien.cx/2023/03/13/how-to-deploy-your-static-site-to-netlify/>
VANCOUVER
Victor Oluwayemi | Sciencx - » How to Deploy your Static Site to Netlify. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2023/03/13/how-to-deploy-your-static-site-to-netlify/
CHICAGO
" » How to Deploy your Static Site to Netlify." Victor Oluwayemi | Sciencx - Accessed . https://www.scien.cx/2023/03/13/how-to-deploy-your-static-site-to-netlify/
IEEE
" » How to Deploy your Static Site to Netlify." Victor Oluwayemi | Sciencx [Online]. Available: https://www.scien.cx/2023/03/13/how-to-deploy-your-static-site-to-netlify/. [Accessed: ]
rf:citation
» How to Deploy your Static Site to Netlify | Victor Oluwayemi | Sciencx | https://www.scien.cx/2023/03/13/how-to-deploy-your-static-site-to-netlify/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.