You can deploy your website using Netlify and Github
Let’s take a look how you can deploy a website using Github:
Step 1: Log in to Github
Once you have logged in successfully, click on the “New” button on the top left side to create a new repository.
Step 2: Create a new repository
Add the repository name and click on the “Create Repository” button.
Once you click on “Create Repository” you will be directed to a page where you will find the commands that you need to execute so that you can push your code to Github.
Execute those commands on your editor (VS code or any other editor)
Step 3: Add your local code to the Github
Once the code is successfully pushed, refresh the page and you will be able to see your files and folders.
Step 4: Go to Settings and look for Github pages
Now to host your website click on “Settings” and scroll down to ‘Github Pages’.
Step 5: Setup Github pages
The next step involves setting up the Github pages. To do this:
- Click on the generated link.
Now let’s see using Netlify
Step 1: Log in to Netlify using Github
On clicking log in, you will be directed to the following page. Click on Github.
Step 2: Authorize Netlify
A sign-in page will appear, where you need to enter your Github credentials and continue.
After the successful authentication, you will be redirected to Netlify’s homepage where you can see all the sites that you have hosted.
Now to host your new website click on the “New Site from Git” button.
Step 3: New Site from Git
Following this, you can choose from where you want to fetch your code(We will use Github)
Step 4: Pick the version control system of your choice: After you click on Github, you will be redirected to an authentication page. After successful authentication, simply choose the repository you want to host your website.
Step 5: Choose the repository of your choice
Once you choose the repository of your choice, check some of your site settings. In most cases, this will be the default setting for you to host your website.
Step 6: Deploy site / Configure settings
Now click on “Deploy site” and Netlify will do the needful.
While your site is being deployed, you will see “site deploy in progress”
Once your site is deployed, you will be able to see the URL.
Click on the URL to access your site.
Your site is now deployed and is accessible to anyone over the internet.