MSK Institute LogoMSK.Institute
HomeCourses
Book Free Demo➔Sign In
Free Demo➔
MSK Institute LogoMSK.Institute

Leading computer training academy in Shikohabad for software engineering, Python, web development, and digital literacy.

ISO 9001:2015 Certified Center
Follow & Connect
4.9

Programs & Admissions

  • All CoursesCatalog
  • Learning PathsRoadmaps
  • Student ProjectsShowcase
  • Live Classes & ScheduleLive
  • Upcoming Batches
  • Campuses & LocationsHub
  • Verify Certificates
  • Book Free Demo Class

Resources & Tools

  • Free Online Mock TestsAll Tests
  • NIELIT CCC Mock TestFree
  • Course & Career FinderQuiz
  • Study Material Hub
  • All MSK ToolsHub
  • Keyboard ShortcutsNew
  • TypeQuest Speed LabTyping
  • MSK Code PlaygroundCode
  • Interactive Tutorials
  • Quick Cheatsheets

Institute & Contact

  • About MSK Institute
  • Careers & InternshipsHiring
  • Publications & Blogs
  • Gali No. 3, Near Gyan Jyoti Public School,
    Adarsh Nagar, Shikohabad, Uttar Pradesh 283135
  • +91 83930 42166
  • mskshikohabad@gmail.com
  • Hours:Mon – Sat: 8:00 AM – 7:00 PM | Sun: 10:00 AM – 2:00 PM
  • 4.9 ★(38 Google Reviews)
© 2026 MSK Institute. All rights reserved.•Privacy Policy•Terms of Service•Disclaimer•Contact Us

Shikohabad's Leading Computer & Coding Academy

Home
Courses
Live
Material
Deploying Web Projects for Free using GitHub Pages0%
Study Materials
Git & GitHub BasicsProgress 0%
1.1What is Version Control? (Local, Centralized vs Distributed VCS)1.2Why Git? History, Architecture & Core Benefits1.3The Three Trees: Working Directory, Staging Area & Git Repository1.4Installing Git and Initial Configuration (git config user.name / email)
8.1Crafting a Professional README.md with Badges, Demos & Markdown8.2Project Management with GitHub Issues, Milestones & Kanban Boards8.3Deploying Web Projects for Free using GitHub Pages
HomeTutorialsGit & GitHub BasicsDeploying Web Projects for Free using GitHub Pages
Collaborative Team Git Flow Simulation (Feature Branches, PRs, Merges)

Deploying Web Projects for Free using GitHub Pages

Beginner12 min read•Updated: 2026-09-15•By Er. Sumit Kumar (MSK Institute)
Study MaterialsCheatsheet

Building a frontend web application is exciting, but sharing it with friends, recruiters, and clients requires hosting. GitHub Pages is a free, blazing-fast static website hosting service integrated directly into GitHub repositories.


1. What is GitHub Pages?

GitHub Pages takes HTML, CSS, JavaScript, images, and static assets straight from a branch in your repository and publishes them live to the internet:

  • Free hosting: Zero monthly hosting fees.
  • Automated SSL: Free HTTPS certificates included out of the box.
  • Custom Domains: Supports connecting your own domain (e.g. portfolio.sumitsharma.dev).
  • Default URL Format:
1 https://<username>.github.io/<repository-name>/
Note
[!NOTE] GitHub Pages hosts static frontends only (HTML, CSS, JS, React client-side builds, Vite builds). It does not execute server-side backends like Python Django, Node.js Express, or PHP.

2. Deploying a Basic Website in 3 Steps

If your repository contains standard static files (index.html, styles.css, app.js):

Step 1: Ensure index.html is at the Root

GitHub Pages looks for index.html as the default entry point of your site.

Step 2: Push Your Code to GitHub

1git add .
2git commit -m "feat: complete portfolio layout"
3git push origin main

Step 3: Enable GitHub Pages in Repository Settings

  1. 1
    On GitHub, navigate to your repository -> Click Settings.
  2. 2
    In the left sidebar under "Code and automation", click Pages.
  3. 3
    Under Build and deployment:
  • Source: Deploy from a branch.
  • Branch: Select main and folder /(root).
  • Click Save.
  1. 1
    Within 60 seconds, GitHub Actions builds and deploys your site! A green banner displays your live URL:

Your site is live at https://sumit-msk.github.io/my-portfolio/.


3. Deploying React / Vite / Next.js Export Builds

For modern frontend frameworks that compile into a dist/ or out/ folder:

Using GitHub Actions (Modern Workflow):

  1. 1
    In Pages Settings, change Source to GitHub Actions.
  2. 2
    Select the Static HTML or Next.js suggested template.
  3. 3
    GitHub automatically creates a .github/workflows/deploy.yml workflow that builds and deploys your application on every push!

4. Configuring a Custom Domain

Want your project to run on mycoolapp.com instead of .github.io?

  1. 1
    In GitHub Pages settings, enter your domain under Custom domain (e.g. www.mycoolapp.com).
  2. 2
    Log into your DNS provider (GoDaddy, Namecheap, Cloudflare).
  3. 3
    Create a CNAME record:
  • Host: www
  • Target / Value: <your-username>.github.io
  1. 1
    Check Enforce HTTPS on GitHub for automatic SSL encryption.

Interactive Quiz• Knowledge Check

Practice Quiz

Question 1
What is GitHub Pages?
Question 2
What file must be present at the root of the selected branch for GitHub Pages to serve a site by default?
Question 3
What type of applications CANNOT be hosted on GitHub Pages?
Question 4
What is the default URL format for a project hosted on GitHub Pages?
Question 5
Does GitHub Pages support free automated HTTPS encryption?
Next Lesson

Collaborative Team Git Flow Simulation (Feature Branches, PRs, Merges)

Continue learning with hands-on practice, examples, and exercises in the upcoming topic.

Related Lessons

Previous LessonNext Lesson
Project Management with GitHub Issues, Milestones & Kanban BoardsCollaborative Team Git Flow Simulation (Feature Branches, PRs, Merges)

Practice Quiz

Test your understanding of this lesson with 5 questions. Each question has one correct answer.

Mentor-Led Practical Training

Master Git & GitHub Basics with Hands-On Projects

Practice in live mentor-led sessions with real projects, mock tests, and verifiable certification at MSK Institute.

View Full CourseBook Free Demo
PreviousNext
PreviousPrevNext