Not only is GitHub a great place to store and share your code with others but it also offers free web hosting of your website! I was able to launch and host my personal website on Github for free following these simple steps:
You will have to create a GitHub account if you do not already have one. You can create an account here. Make sure the user name you select will be the username name you would want your website url to be, preferably your first and last name e.g JohnDoe.
After you have set up your account and signed in, the next thing you have to do is create a new repository. You can see the option to create a new repository on the leftmost panel on your dashboard called repositories. You will find a green button called new, click on it. You will directed to a new page where you would enter information for creating a new repository like repository name, description etc. For your repository name use [username].github.io, where username is your username on GitHub. Make your repository public. See picture below for more details.
After creating your new repository, you will find it under the repositories panel of your dashboard. Click on your repository name and it should take you to your repository page. At the rightmost corner of your repository page you can see the option to clone repository. Click on the clone repository button and select the download zip option. This will download a folder to your system, subsequently this folder is where you will place all your website files.
Launch the terminal on your system. Change directory (cd) till you get to the directory where your cloned repository folder was downloaded on your system. Enter these two commands:
To make the changes you have made to your website folder reflect on your actual website, you will need to add, commit, and push your changes. To do this continue where you left off in your terminal, enter the following commands:
Your website is ready! Open up any browser of your choice and go to https://username.github.io.You should see the index.html file you added, subsequently you can add new files in the same manner.
Alternatively, if you use Github Desktop you can follow the steps explained in this blog.