Bonus: Put Your Project Online with GitHub Pages
What GitHub and GitHub Pages actually are, why a live link beats a saved file, and the exact steps to publish an HTML build — or a React one — for free.
🎁 This One’s Optional
Everything that matters for this workshop already happened — you built, you tested, you shipped a demo. This lesson is for after today, for anyone who wants their project to keep existing as a real link on the internet instead of a file sitting on one laptop. No pressure to do this live; read it now, try it whenever.
🤔 What Even Is GitHub?
Two new words are about to show up a lot, so let’s define them plainly before touching anything:
GitHub is a website that stores your project’s files online — think of it like the Google Drive folder you’ve been saving into all week, except it’s built specifically for code, and it automatically keeps a full history of every version, instead of you manually typing _v1, _v2 into filenames.
A repository (everyone just says “repo”) is one project’s folder on GitHub. One repo = one project.
GitHub Pages is a free feature that takes the files sitting in a repo and turns them into an actual website — with a real, clickable web address, like https://yourname.github.io/your-project/.
🛫 Why Bother?
Right now, your project only opens for someone who has the actual file and knows how to open an HTML file — that’s a real barrier for a parent, a friend, or a potential employer. A live link works instantly on any phone, laptop, or browser, with nothing to download.
It’s also free, permanent, and it’s the exact same infrastructure real companies and open-source projects run on. A working link in a portfolio or an internship application says “I built and shipped something real” far louder than a screenshot.
📄 Section 1: Hosting Your HTML Project
This is the one that applies to almost everyone in the room — every project you built this week with Gemini Canvas is a single, self-contained HTML file. That makes hosting it genuinely simple: no build step, no terminal required.
- Go to github.com and create a free account, if you don’t already have one.
- Click New repository. Give it a short name (like
clear-the-runway), set it to Public, and create it. - Inside the new repo, click Add file → Upload files, and drag in your saved
.htmlfile. - Rename the uploaded file to exactly
index.html— GitHub Pages automatically serves whatever file is namedindex.htmlas your site’s homepage. This step is easy to miss and nothing loads without it. - Go to the repo’s Settings → Pages. Under “Build and deployment,” set Source to Deploy from a branch, branch to main, folder to / (root), then Save.
- Wait about a minute, then refresh that same Settings → Pages screen — your live URL appears at the top, something like
https://yourname.github.io/clear-the-runway/.
Open that link. That’s your project, live, on the actual internet.
If you upload maria_day2_v2.html and leave it named that, your live URL will show a blank error page — GitHub Pages doesn’t know to look for it. It specifically looks for a file named index.html at the root of the repo. Rename before you turn Pages on, and this disappears as a problem.
⚛️ Section 2: Hosting a React Project
Skip this section unless you know your project was built as a React app rather than a single HTML file — this mostly applies if you’re one of the Software Engineering majors who went further with Canvas this week. A React project isn’t one file; it’s a small collection of files that has to be built — compiled down into plain HTML, CSS, and JavaScript — before it can go live anywhere. That build step is the whole difference from Section 1.
| Plain HTML (most projects this week) | React project | |
|---|---|---|
| What you have | One .html file, ready to open | Many source files, need a build step |
| To publish | Upload the file directly | Build it first, then publish the output |
| Terminal needed? | No | Yes |
- Make sure your project is already pushed to a GitHub repo (same account/repo setup as Section 1, but using
gitinstead of drag-and-drop — ask Gemini for the exactgit init/git pushcommands for your operating system if you haven’t done this before; that’s a completely normal use of the loop you’ve practiced all week). - Install the deploy helper:
npm install --save-dev gh-pages - Open
vite.config.jsand add your repo name as thebasepath:export default { base: '/your-repo-name/' } - In
package.json, add a deploy script:"scripts": { "deploy": "vite build && gh-pages -d dist" } - Run
npm run deployin your terminal. This builds your app and pushes the finished output to agh-pagesbranch on your repo. - In the repo’s Settings → Pages, set Source to Deploy from a branch, branch to gh-pages, folder to / (root), then Save.
- Your live URL appears the same way as Section 1:
https://yourname.github.io/your-repo-name/.
This is the single most common React-on-GitHub-Pages mistake: the page loads but shows nothing. Almost always, it’s the missing base path in step 3 — without it, your app looks for its files at the root of the domain, but GitHub Pages serves your project from a subfolder (/your-repo-name/). If you hit a blank page, that’s the first thing to check.
You upload your HTML file to a new GitHub repo, turn on GitHub Pages, and visit your new URL — but it shows a 404 error instead of your project. You didn't touch the React steps at all. What's the most likely cause?
Reveal Answer & Explanation
The uploaded file isn’t named exactly index.html.
For a plain HTML project, GitHub Pages looks specifically for a file called index.html at the root of the repo to know what to serve as your homepage. If your file is still named something like maria_day2_v2.html, GitHub Pages has nothing to show — rename it to index.html and the same URL starts working within a minute.
⏭️ Up Next
You’ve got a working project, a way to describe what you want and get real code back, a lens for who you’re building for, a way to debug when it breaks, real feedback you acted on, and now — if you want it — a permanent, public home for what you built. One more optional lesson left: turning that project into a story someone actually remembers.