Embark on a journey of knowledge! Take the quiz and earn valuable credits.
Take A QuizChallenge yourself and boost your learning! Start the quiz now to earn credits.
Take A QuizUnlock your potential! Begin the quiz, answer questions, and accumulate credits along the way.
Take A Quiz
🧭 What You’ll Learn
By the end of this chapter, you'll be able to:
🌐 Why GitHub Pages?
GitHub Pages is a free hosting service offered by
GitHub that allows you to publish static websites (HTML, CSS, JS) directly from
a GitHub repository.
✅ Benefits of GitHub Pages
🔧 Step-by-Step Guide to
Deploy Your Portfolio with GitHub Pages
🛠️ Step 1: Set Up a
GitHub Account
If you haven’t already:
📁 Step 2: Create a New
Repository
📂 Step 3: Upload Your
Website Files
You have two options:
🅰️ Upload via GitHub Web
Interface (Easy)
🅱️ Upload Using Git
(Command Line)
If you have Git installed locally:
bash
#
Clone the repo
git
clone https://github.com/yourusername/portfolio.git
#
Move into the folder
cd
portfolio
#
Add your website files
cp
-r ../local-website/* .
#
Commit and push
git
add .
git
commit -m "Initial commit"
git
push origin main
🚀 Step 4: Enable GitHub
Pages
After a few seconds, you’ll see a confirmation message:
“Your site is published at
https://yourusername.github.io/portfolio/”
🌍 Accessing Your Live
Website
You can now visit your site via the URL:
text
https://yourusername.github.io/repository-name/
For example:
text
https://alexsmith.github.io/portfolio/
🧱 Optional: Deploy from
/docs Folder
If your website files are inside a docs/ subfolder:
This is useful if your main repo includes source code or
other files.
🌐 Step 5: Add a Custom
Domain (Optional)
Want a cleaner URL like www.alexsmith.dev?
🪜 How to Set It Up:
A. Buy a domain
Use providers like Namecheap, GoDaddy, or Google Domains.
B. Point DNS to GitHub
Set your DNS records:
Type |
Name |
Value |
A |
@ |
185.199.108.153 (and
others) |
CNAME |
www |
yourusername.github.io |
C. Add a CNAME file in your repo root:
CNAME
www.yourcustomdomain.com
D. Enforce HTTPS
GitHub will provision an SSL certificate automatically (can
take up to 24 hours).
📊 Table: Deployment
Checklist
Task |
Done |
GitHub account
created |
✅ |
Repository initialized |
✅ |
Website files
uploaded |
✅ |
GitHub Pages enabled |
✅ |
Site verified live |
✅ |
Custom domain linked (opt.) |
✅ |
HTTPS enforced |
✅ |
🧪 Testing Your Site
After publishing:
🧰 Updating Your Site
Every time you make changes:
bash
git
add .
git
commit -m "Updated About section"
git
push origin main
❌ Common Deployment Errors &
Fixes
Issue |
Cause |
Solution |
404 Not Found |
No index.html in root |
Ensure index.html is
at root or /docs |
CSS not loading |
Incorrect
path |
Use relative
paths like ./css/style.css |
Broken images |
Misspelled filenames
or wrong paths |
Match case and check
folder names |
No HTTPS |
HTTPS not
enforced |
Check
“Enforce HTTPS” under Pages settings |
Domain not
resolving |
DNS propagation delay |
Wait 1–24 hours; check
DNS settings |
🧠 Advanced Tips
🔁 Sample Deployment
Automation (GitHub Actions)
For advanced users building with React or another framework:
yaml
name:
Deploy
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: npm install && npm run
build
- run: git add build -f
- run: git commit -m "Deploy"
- run: git push origin `main`
📌 Summary
GitHub Pages offers a simple and free way to host your
portfolio.
You’ve now learned how to:
Your site is now online, professional, and accessible
to the world!
Answer:
Yes! With the right structure, pre-written content, and a simple template, you
can absolutely build and launch a functional personal portfolio site in 6–8
hours.
Answer:
Not necessarily. You can use free HTML templates and just customize the text
and images. But basic knowledge of HTML and CSS will help you make edits and
personalize it further.
Answer:
A simple portfolio should include:
Answer:
You can find high-quality templates on sites like HTML5 UP, BootstrapMade,
Templatemo, or search GitHub
for “portfolio template.”
Answer:
You can use GitHub Pages—it’s completely free and perfect for static
websites. Simply upload your HTML/CSS files to a public GitHub repository and
enable Pages in the settings.
Answer:
Yes! You can register a domain from providers like Namecheap or GoDaddy and
point it to your GitHub Pages site using a CNAME file and DNS settings.
Answer:
At minimum, you’ll need:
You won’t need any paid software.
Answer:
Yes, it’s a good idea to include a downloadable PDF version of your resume or
link to it via Google Drive. It makes it easier for recruiters to access.
Answer:
Use clean design, modern fonts (like Google Fonts), high-quality images, and
consistent spacing. You don’t need fancy animations—clarity and simplicity win.
Answer:
Please log in to access this content. You will be redirected to the login page shortly.
LoginReady to take your education and career to the next level? Register today and join our growing community of learners and professionals.
Comments(0)