Overview
GitHub Pages is a free static site hosting service that deploys directly from a GitHub repository. It’s perfect if you’re already using GitHub for version control.GitHub Pages is completely free for public repositories with unlimited bandwidth.
Prerequisites
- A GitHub account (create one at github.com)
- Your portfolio template folder ready to upload
- Basic familiarity with GitHub (helpful but not required)
Deployment Steps
1
Create a GitHub Repository
- Log in to GitHub
- Click the + icon in the top-right corner
- Select New repository
- Name your repository (e.g.,
my-portfolio) - Choose Public visibility
- Do NOT initialize with README, .gitignore, or license
- Click Create repository
2
Upload Your Portfolio Files
3
Enable GitHub Pages
- In your repository, click Settings (top navigation)
- Scroll down and click Pages in the left sidebar
- Under Source, select Deploy from a branch
- Under Branch, select
main(ormaster) and folder/ (root) - Click Save
You’ll see a message: “Your site is ready to be published at
https://username.github.io/repository-name/”4
Access Your Live Portfolio
- Wait for the deployment to complete (refresh the Pages settings page)
- Once ready, you’ll see: “Your site is live at
https://...” - Click the URL to view your live portfolio
- Share this URL with anyone to showcase your work
Updating Your Portfolio
To make changes after deployment:1
Edit Your Local Files
Make changes to your HTML, CSS, or JavaScript files locally.
2
Upload Changes
Via Web Interface:
- Navigate to the file in your repository
- Click the pencil icon (Edit)
- Make changes and commit
3
Wait for Redeployment
GitHub Pages automatically redeploys when you push changes. Wait 1-2 minutes, then refresh your live site.
Custom Domain Setup (Optional)
1
Purchase a Domain
Buy a domain from a registrar like:
- Namecheap
- Google Domains
- GoDaddy
- Cloudflare
2
Configure DNS Records
In your domain registrar’s DNS settings, add these records:For apex domain (example.com):For subdomain (www.example.com):
3
Configure GitHub Pages
- Go to repository Settings > Pages
- Under Custom domain, enter your domain (e.g.,
www.example.com) - Click Save
- Wait for DNS check to complete
- Enable Enforce HTTPS (recommended)
4
Wait for Propagation
DNS changes can take 24-48 hours to propagate. Your site will be accessible at your custom domain once complete.
Troubleshooting
Site Not Loading
Check file structure
Check file structure
Ensure
index.html is at the root level of your repository, not in a subfolder.Verify GitHub Pages is enabled
Verify GitHub Pages is enabled
Go to Settings > Pages and confirm the source branch is set correctly.
Check for build errors
Check for build errors
Look at the Actions tab in your repository for deployment logs.
CSS/Images Not Loading
Use relative paths
Use relative paths
Change absolute paths like
/css/style.css to relative paths like css/style.css or ./css/style.css.Check file names
Check file names
Ensure file names match exactly (case-sensitive on GitHub Pages).
Best Practices
GitHub Pages has a soft bandwidth limit of 100GB/month and 10 builds/hour. This is more than sufficient for personal portfolios.
Next Steps
Custom Domain
Follow the custom domain setup guide above to use your own domain name.
SEO Optimization
Add meta tags and optimize your portfolio for search engines.