DEV Community

Kavin Desi Valli
Kavin Desi Valli

Posted on • Originally published at livecode247.com on

Deploying a static HTML and CSS site using Github Pages

The next step after creating a website, is deploying it to make it available to the whole world. If your site is static, and doesn't use any backend then it is pretty straightforward to deploy your app. In this article, I'm gonna talk about how to deploy a static HTML and CSS site using Github Pages.

Register at Github

First of all create an account at Github. Github is a Git repository hosting service which is owned by Microsoft. It provides a great feature called Github Pages and can be used to deploy static sites.

Create a Github Repository

After registering, click on the button which says New on the top left of the page. Create Repository Create repository input repo name

Upload files

If you know git, you're welcome to push your files to Github. Else, no worries, you can use Github's file upload feature like so:

Upload files to Github

Enable Github Pages

Last step is to enable Github Pages like so:

  1. Click on Settings Enable Github Pages
  2. Click on Pages Screenshot 2022-03-07 at 19.12.05.png
  3. Click on Branch and choose master

This might be main depending on the default branch you're working on

  1. Click on the button on the right of Branch and choose / (root)
  2. Click on Save

Then wait for some time and then refresh. Wait till you see a banner which says something like this: Banner which says site's published

And there it is! You've deployed your site using Github Pages. For example, you can view the sample deployment here.

Links

You can find the sample github repository in the example here:

https://github.com/kavinvalli/gh-pages-tutorial

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay