Beginner's Guide to GitHub Pages Pt. 2

What You'll Learn

  • What GitHub Pages is

  • How to publish a website online

  • How to generate a shareable website link

  • How to update a website after publishing

Overview

Have you ever wanted to share your coding projects with friends, teachers, or family?

GitHub Pages allows you to turn your HTML, CSS, and JavaScript projects into real websites that anyone can visit.

By the end of this guide, you'll have a live website with its own URL that you can share with others.

What Is GitHub Pages?

GitHub Pages is a free service provided by GitHub that hosts websites directly from your repositories.

Instead of keeping your project only on your computer, GitHub Pages makes it available on the internet.

Why Use GitHub Pages?

🌎 Turn your project into a real website

🔗 Get a shareable URL

📱 Works on phones, tablets, and computers

💻 Completely free

🔄 Updates automatically when you make changes

Before You Start

Make sure you have:

✅ A GitHub account

✅ A repository containing your project

✅ An index.html file in your repository

If you haven't created a GitHub account yet, complete Guide 1: What Is GitHub and How to Set It Up?

Step 1: Open Your Repository

  1. Log in to GitHub.

  2. Click your profile picture.

  3. Select Your Repositories.

  4. Open the project you would like to publish.

Example:

my-first-website

Step 2: Open Repository Settings

At the top of your repository page, locate the navigation menu.

Click:

Settings ⚙️

Can't Find Settings?

Make sure:

  • You are logged into your account.

  • You own the repository.

  • You are not viewing someone else's project.

Step 3: Find GitHub Pages

Inside the Settings menu:

  1. Locate the left sidebar.

  2. Scroll until you see Pages.

  3. Click Pages.

You are now in the GitHub Pages settings.

Step 4: Publish Your Website

Choose a Source

Under Build and Deployment:

  1. Find the Source dropdown menu.

  2. Select:

main

(Some repositories may use "master" instead.)

Choose a Folder

Select:

/ (root)

This tells GitHub to use the files located in your repository.

Save

Click Save.

GitHub will begin building your website.

Step 5: Wait for Deployment

Publishing usually takes 1–2 minutes.

After a short wait, refresh the page.

You should see a message similar to:

"Your site is live at"

followed by your website URL.

Step 6: Visit Your Website

Click the provided link to view your live website.

Example URLs:

Congratulations! Your project is now available online.

Updating Your Website

Any time you update the files in your repository:

  1. Upload the new version to GitHub.

  2. Wait a few minutes.

  3. Refresh your website.

GitHub Pages will automatically publish the updated version.

What You Learned

By completing this guide, you have:

✅ Published a website online

✅ Created a public project portfolio

✅ Generated a shareable website link

✅ Learned the basics of web hosting

Troubleshooting

My Website Shows a 404 Error

Check that:

  • Your repository contains an index.html file.

  • GitHub Pages is enabled.

  • You selected the correct branch (main or master).

My Changes Aren't Appearing

Try:

  • Waiting a few minutes

  • Refreshing your browser

  • Confirming your files were uploaded correctly

I Can't Find the Pages Menu

Ensure you are:

  • Logged in

  • Viewing your own repository

  • Looking inside Repository Settings

Next Challenges

Beginner

  • Add more pages to your website.

  • Add images and links.

  • Customize colors and fonts.

Intermediate

  • Create a personal portfolio website.

  • Add a navigation menu.

  • Create a contact page.

Advanced

  • Connect your own custom domain.

  • Build a multi-page website.

  • Create a project portfolio showcasing all your coding work.

Real-World STEM Connection

Software engineers, web developers, designers, and entrepreneurs regularly use web hosting platforms to publish websites and applications. Learning GitHub Pages introduces one of the most common ways developers share their work and build professional portfolios online.

Extension Activity

Now that your website is live, share it with a friend, teacher, or family member and ask for feedback. Real developers constantly improve their projects based on user feedback.

Next
Next

Beginner's Guide to GitHub