How to Deploy a Static Blog to GitHub Pages
Home > Tutorials > How to Deploy a Static Blog to GitHub Pages
Archive
- Install Apache, MySQL, PHP and phpMyAdmin on Archlinux 2021
- Configure an Apache Virtual Host Server on ArchLinux Jun 12, 2021
- How to Deploy a Static Blog to GitHub Pages Nov 17, 2026
- How to Sign Up for make.fun with an Agent and Let the Agent Find Bounties on Its Own Nov 17, 2026
- How to Mint Free NFTs on BSC Safely Nov 30, 2026
- How to Make Automated Story YouTube Shorts (Stickman + TTS) Nov 30, 2026
A static blog is a blog whose content is just HTML, CSS, and image files — no database and no server-side programming language. This very blog is an example: all of it is just HTML and CSS files, yet anyone can open it over the internet. The hosting is free, using GitHub Pages.
Figure 1: The static blog deployment flow to GitHub Pages — from blog files to a live blog.
What You Need
- A GitHub account (free, sign up at github.com).
- Your blog files — at minimum index.html.
- A browser.
Step 1: Create a Repository
Log in to GitHub, click the + button at the top right, then choose New repository. Fill in Repository name with username.github.io — replace username with your GitHub username. Choose Public, then click Create repository.
username.github.io
Tip: If you want to make a second blog, the repository name is up to you, for example blog-saya. Its address will then be username.github.io/blog-saya.
Step 2: Upload the Blog Files
On the repository page, click Add file, then Upload files. Drag the index.html file, the css folder, and the img folder there, then click Commit changes. The index.html file is required — it's your blog's home page.
Figure 2: Example of a blog repository's contents — the index.html file is required.
If you're already comfortable with Git, you can push via the terminal:
git init
git add .
git commit -m "Blog pertama"
git remote add origin https://github.com/username/username.github.io.git
git push -u origin main
git add .
git commit -m "Blog pertama"
git remote add origin https://github.com/username/username.github.io.git
git push -u origin main
Warning: Don't upload secret files like passwords or API keys to a public repository — everyone can see its contents.
Step 3: Enable GitHub Pages
Go to the Settings tab in your repository, then choose Pages in the left menu. In the Branch section, choose main and the / (root) folder, then click Save.
Step 4: Open Your Blog
Wait 1–2 minutes until GitHub finishes building your blog, then open its address:
https://username.github.io/
Tip: If the page hasn't appeared yet, wait a moment and then refresh. The first GitHub Pages build usually takes 1–2 minutes.
Update the Blog
To change the blog's content, edit the files directly on GitHub or push again via Git. GitHub Pages will rebuild your blog automatically within 1–2 minutes.
References
- https://docs.github.com/en/pages/getting-started-with-github-pages
- https://docs.github.com/en/pages/quickstart
Like this tutorial? Support the author so there are even more free tutorials.
Support via Saweria
Comments