How to publish HTML file in GitHub

Sanjana V
featurepreneur
Published in
2 min readAug 9, 2021

In this article, we are going to learn how to publish our HTML files with Github.

Let’s start. First of all, you need to create a new repository for this.

After created your repository, let’s add our .html file. We are adding index.html because GitHub renders index.html first.

After that click the “settings” of the repository.

If you scroll down on the settings page, you will see that there is a section called GitHub pages and GitHub pages are designed to host your personal organization or project pages from a GitHub repository. So, we already have the repository. We now have to activate our pages. So it’s currently disabled.

All we have to do to enable it we just have to select a source where our files reside. You should change the setting to the master branch and go ahead and click save.

So now GitHub is going to do some behind the scenes stuff and it’s going to be publishing towards a place that is going to be your username.github.io/your project name.

So you’ll be able to access the site from anywhere across the world, as long as you’re connected to the internet. Now, this publishing process takes a little while. So if you refresh this page, you’ll see that it says your site is published at this address. And if you click on that address, you should be able to see your website show up.

Now you can go ahead and share this link with anybody you like across the world and they can access it because it’s now hosted on the internet.

Thanks for Reading!!

--

--