Skip to main content

Command Palette

Search for a command to run...

How to Publish a Website on GitHub Pages

a step-by-step guide

Published
2 min read
How to Publish a Website on GitHub Pages

There was a time when I finished a static webpage and had no idea what to do next; I thought I would be able to visit a live site without publishing it, which is funny, right?

To avoid thinking the same way I did, I will walk you through how to publish on GitHub pages. If you are unfamiliar with GitHub, it is a platform that allows you to store and share your codes as well as host your static web pages (HTML, CSS, and JavaScript projects).

If you want to host a website on GitHub, you must first create a GitHub account, which will allow you to upload all of your project files (assets and source codes) to GitHub. It is required to host a website on GitHub.

Now that we are all set, let's proceed to publish our first website on GitHub.

STEP 1: Go to your project's repository

Once you are logged in to your account, proceed to the repository at the top of the page and click on the one you want to publish.

HOME.jpg

REPO1.jpg

Step 2: Select settings

In your current repository, click the settings link which would take you to a new page (the repository's settings page).

OLM.jpg

Step 3: Click on GitHub Pages

In the repository's settings, you would get a list of options, scroll down a bit and select GitHub Pages (depending on your screen size you might not need to scroll), this would take you to GitHub Pages.

SET.jpg

Step 4: Select the branch and save

Once you are on the GitHub pages, go to the source section and select the branch you want to host from (master or main branch), and click save.

SAVE.jpg

Step 5: Your site is live!!

Hurray!!!, your site is now live, it would only take a few minutes before you can access the site, refresh the page then use the link provided to view the amazing work you have done.

LIVE.jpg

EXTRA TIPS

  • Always ensure that your folders are well structured, as failure to do so might lead to you being unable to access your page

  • Always name your root HTML page as index.html.

  • Check your files, folders, and folders for spelling mistakes.

Conclusion

I hope you found this article useful, and now that you know how to publish your projects to GitHub pages, you won't have to worry about how web publishing works like I did.

Happy coding.

A
Alabadi3y ago

شكراً لك اخي

M

عفواً

M

Well-done boss

M

Thanks main boss, hope it was helpful.