Finished building your website and now wondering how to put it online — for free? With GitHub Pages, you can host static websites (HTML, CSS, JavaScript) directly from a GitHub repository. It’s fast, reliable, and doesn’t cost a single rupee. In this blog, you’ll learn how to deploy your site step-by-step.
🧠 What is GitHub Pages?
GitHub Pages is a free static site hosting service provided by GitHub. It takes your HTML/CSS/JS files from a repo and serves them as a live website with a public URL.
✅ Prerequisites
- A GitHub account (free)
- Git installed on your system
- A completed static website (HTML/CSS/JS)
🚀 Step-by-Step Deployment
1. 🗂 Create a GitHub Repository
- Go to https://github.com
- Click “New” > Name your repo (e.g.,
my-website
) - Set visibility to Public
- Click Create Repository
2. 💻 Push Your Website Files to GitHub
Open terminal or Git Bash in your website folder:
bashCopyEditgit init
git remote add origin https://github.com/yourusername/my-website.git
git add .
git commit -m "Initial commit"
git push -u origin master
💡 Replace the repo URL with yours.
3. 🌐 Enable GitHub Pages
- Go to your repo settings
- Scroll to Pages section
- Under “Source”, choose
main
branch and/ (root)
- Click Save
🟢 You’ll see a message like:
Your site is live athttps://yourusername.github.io/my-website/
🔁 Make Updates Later?
Whenever you update files, just push them:
bashCopyEditgit add .
git commit -m "Updated homepage"
git push
The live site will auto-update!
💡 Bonus Tips
- Use
index.html
as the main entry point. - Don’t upload server-side files (e.g., PHP) — GitHub Pages is for static sites only.
- Custom domain? You can add it in GitHub Pages settings.
Conclusion:
GitHub Pages is the perfect platform for beginners to publish projects, portfolios, or documentation. No complex setup, no monthly charges — just push your code and go live in minutes.
🔗 Try it today and share your live portfolio with the world!