Let's first know what hosting means.

When a hosting provider allocates space on a web server for a website to store its files, they are hosting a website. Web hosting makes the files that comprise a website (code, images, etc.) available for viewing online. Every website you’ve ever visited is hosted on a server. The amount of space allocated on a server to a website depends on the type of hosting. The main types of hosting are shared, dedicated, VPS and reseller. They are differentiated by the kind of technology used for the server, the level of management provided, and the additional services on offer.

Are you ready? let’s get started!

Step 1: Create/ Sign in to your GitHub account. 

Step 2: Create a new GitHub Repository Go into your dashboard and find a “New Repository” button. Click on it to create a new repository and name it whatever you want, I named my repository gh-page-demo and in the description, you can give some information about your repository.

Github create repository page

Step 3: Upload or push your website to the repository which you created.

Step 4: Go to settings and scroll down to Github pages

Step 6: Click on the dropdown currently showing none and select your branch in my case it is main, and then click to save button.

Github - Repository settings page

Step 7: Click on save, and you can see a URL on the top of it in the format of

https://<username>.github.io/<repo name>

Alright, now you might ask what is Github Pages?

GitHub Pages is a static site hosting service that takes HTML, CSS, and JavaScript files straight from a repository on GitHub, optionally runs the files through a build process and publishes a website. You can see examples of GitHub Pages sites in the GitHub Pages examples collection.

You can host your site on GitHub's github.io domain or your own custom domain. For more information, see Using a custom domain with GitHub Pages.

You can create GitHub Pages sites that are publicly available on the internet. Organizations that use GitHub Enterprise Cloud can also publish sites privately by managing access control for the site. For more information, visit here in the GitHub Enterprise Cloud documentation.

Organization owners can disable the publication of GitHub Pages sites from the organization's repositories. For more information, visit here

If you find this article helpful please share it with your friends. Also, love to hear your opinions and thoughts on this. You can find me on Twitter.