How github pages work?
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.
Step by step process to publish a website using Github pages:
Step 1
You should have a repository, if you don't go on this page to know how to create a repository.
Step 2
Now if your repository have an "index.html" file, then github understands what you want to do.
Step 3
Go to repository in Github and click on settings.
Step 4
Click on the pages option on the sidebar menu.
Step 5
Select the main branch in dropdown menu for branch.
and hit Save. Your Github pages source is saved.
You can check the process happening in actions tab.
and when the action gets completed.
Step 6
Go back to settings > pages and click on Visit site to see the deployment.