Hosting a static website on GitHub pages, the beginner's guide.

Hosting a static website on GitHub pages, the beginner's guide.

Β·

4 min read

Thank you for taking out time to read my blog, today we will see how we can easily host a static website on GitHub pages.

Hosting a website used to be a big deal back in the days but technologies have gone far now, you can easily host a website on GitHub in less than 3mins thanks to GitHub pages. in the end, we will learn how to host a website like this πŸ‘‡πŸΌ

shoot.gif

Why you should host your website on GitHub pages.

  • GitHub pages is free

  • Free hosting with >95% uptime

  • GitHub pages is fast

  • GitHub pages is easy to setup

  • GitHub pages is very secure

Scenario you might want to avoid.

Have you ever found yourself in a situation where you wanted to show off your projects to a friend or to a client and you need to come with your laptop because the projects have not been hosted yet?

is a very bad experience but hosting your projects online and work on them as you go and can easily give someone a link to check them, it gives you peace of mind and comfort.

Steps to host your website on GitHub pages.

is assumed that you have a GitHub account but if you don't signup is free.

  1. Create a new repository for your project . Screenshot (54).png

  2. Clone the repository to your local machine Screenshot (55).png

  3. Open the folder with your text editor and make changes . Screenshot (58).png

  4. Push your code to GitHub via gitbash, vscode, or any way you prefer. Screenshot (59).png

  5. Go to your Github and open the repository you want to host to GitHub pages, in this tutorial we are hosting the repository call tesla click on Settings at the top right corner. Screenshot (61).png

  6. scroll down at the end of the page where you will see GitHub Pages click at the none button and select the main then click save.

Screenshot (62).png

voila πŸ‘πŸΌπŸ‘‡πŸΌ

2e0da78ff536fdc7427fc5d6669b79e957a9d1b8.gif

You can get all the codes for this projects and more on my GitHub account GitHub 🀩

Conclusion

There other things you can do with git hub pages, like add your custom domain name and others. but this blog is just on how to simply host a static website, i hope you enjoyed it please drop a like and comment bellow let me know what you think, thanks and have a great day.

Refrence