π Objective: Learn how to deploy a Bootstrap website using GitHub Pages, Netlify, and Vercel for free.
πΉ 1. Introduction to Website Deployment
After building a website, you need to host it online so others can access it.
π‘ Best Free Hosting Platforms:
βοΈ GitHub Pages β Best for static sites, easy Git integration.
βοΈ Netlify β Great for static & dynamic sites, supports continuous deployment.
βοΈ Vercel β Best for Next.js & React projects, fast global CDN.
πΉ 2. Deploying with GitHub Pages
GitHub Pages allows you to host static HTML, CSS, and JavaScript files directly from a GitHub repository.
1οΈβ£ Step 1: Push Your Website to GitHub
β Create a New Repository on GitHub:
- Go to GitHub and click New Repository.
- Name the repository (e.g.,
my-bootstrap-website
). - Select Public and click Create Repository.
β Upload Your Website via Git
πΉ What happens?
- Your project is now on GitHub.
2οΈβ£ Step 2: Enable GitHub Pages
- Go to your repository on GitHub.
- Click Settings β Pages.
- Under Source, select Deploy from branch.
- Choose main branch and click Save.
- GitHub generates a link:
πΉ What happens?
- Your website is live on GitHub Pages! π
πΉ 3. Deploying with Netlify
Netlify allows you to deploy a website with drag-and-drop or Git integration.
1οΈβ£ Step 1: Upload Files to Netlify
- Go to Netlify and sign up.
- Click New Site from Git.
- Choose GitHub and select your repository.
- Click Deploy Site.
- Your website will be hosted at:
πΉ What happens?
- Netlify automatically deploys your site and updates on each Git commit.
πΉ 4. Deploying with Vercel
Vercel is best for modern web apps and frameworks.
1οΈβ£ Step 1: Deploy on Vercel
- Sign up at Vercel.
- Click New Project.
- Choose Import Git Repository.
- Select your Bootstrap project repository.
- Click Deploy.
- Your site will be hosted at:
πΉ What happens?
- Vercel deploys and provides automatic updates.
πΉ 5. Custom Domains (Optional)
You can connect a custom domain to GitHub Pages, Netlify, or Vercel.
β Example: Custom Domain on Netlify
- Go to Netlify β Site Settings.
- Click Domain Management.
- Add a custom domain (e.g., mywebsite.com).
πΉ What happens?
- Your site works with your domain name.
π Lesson Recap Quiz
π― Test your knowledge of website deployment.
π Multiple-Choice Questions (MCQs)
1οΈβ£ Which platform is best for hosting static sites?
a) GitHub Pages
b) Netlify
c) Vercel
d) All of the above
β Correct Answer: d) All of the above
2οΈβ£ What command pushes your project to GitHub?
a) git deploy
b) git push origin main
c) git upload
d) git publish
β
Correct Answer: b) git push origin main
π True or False
3οΈβ£ Netlify can deploy directly from GitHub.
β
Answer: True
4οΈβ£ You must pay to use GitHub Pages.
β
Answer: False
π― Practical Challenge
β
Deploy your Bootstrap website on GitHub Pages.
β
Deploy the same website on Netlify or Vercel.
β
Connect a custom domain (Optional).
β
Post your live website link in the discussion forum for feedback!
π Lesson Summary
β
GitHub Pages, Netlify, and Vercel provide free hosting.
β
GitHub Pages is best for simple static sites.
β
Netlify & Vercel offer better automation & custom domains.
β
Deployment ensures your website is accessible to users worldwide.