Lesson 8.1: Hosting Websites on GitHub Pages / Netlify
In this lesson, students will learn how to make their websites live online using free hosting platforms like GitHub Pages and Netlify.
1. Why Hosting is Important
-
Hosting allows your website to be accessible to anyone on the internet.
-
Helps showcase your portfolio or projects professionally.
-
Free platforms like GitHub Pages and Netlify make it easy for beginners.
2. Hosting on GitHub Pages
Step 1: Create a GitHub Repository
-
Go to GitHub and create a new repository (e.g.,
my-portfolio). -
Initialize with a README (optional).
Step 2: Upload Your Website Files
-
You can drag and drop HTML, CSS, JS files to the repository.
-
Ensure index.html is the main file.
Step 3: Enable GitHub Pages
-
Go to Settings → Pages → Source
-
Select the main branch and save.
-
GitHub will provide a live URL like
https://username.github.io/my-portfolio/.
Step 4: Access Your Website
-
Open the provided URL in a browser to see your live website.
3. Hosting on Netlify
Step 1: Sign Up / Log In
-
Go to Netlify and create a free account.
Step 2: Deploy a New Site
-
Click “Add New Site → Deploy manually”.
-
Drag and drop your website folder containing HTML, CSS, JS files.
Step 3: Site Settings
-
Netlify automatically gives a temporary URL.
-
You can customize the domain if needed.
Step 4: Continuous Deployment (Optional)
-
Connect Netlify with GitHub repository for automatic updates whenever you push code.
4. Best Practices
-
Always name your main file index.html.
-
Keep your folder structure clean.
-
Test website links and assets before deploying.
-
Use custom domains later for professional portfolio sites.
✅ Summary:
-
Hosting makes your website live on the internet.
-
GitHub Pages is simple for static websites.
-
Netlify is beginner-friendly and supports continuous deployment.
-
Essential for portfolio projects and professional presentation.
