Lesson 12: Deploy and Share
| Course home | Previous: Lesson 11 |
Time: about 60 minutes.
Hosting plans change. Free-tier details below were checked against official pages in December 2026; follow the links for current terms.
Goals
By the end of this lesson you will be able to:
- Explain what deploying a static site means.
- Run a pre-launch checklist.
- Publish Tiny Habits on GitHub Pages.
- Know how to use Cloudflare, Netlify or Vercel instead.
- Update the live site safely.
- Plan your next project using everything from the course.
Concepts
What “deploy” means for a static site
Your app is just files: index.html, styles.css, app.js, habits.js, storage.js. Deploying means copying them to a server that hands them to anyone who visits a URL. There is no server code to run, no database to set up. That is why it can be free.
Your tests/ folder and package.json can be uploaded too; they do no harm, but they are not needed by visitors.
Where to host
| Host | Free option | How you deploy | Good to know |
|---|---|---|---|
| GitHub Pages | Yes, for public repositories | Settings, Pages, pick a branch and folder | Published sites up to 1 GB; soft bandwidth limit of 100 GB a month; not for running an online business (limits) |
| Cloudflare Workers static assets | Yes, Workers Free plan | npx wrangler deploy with an assets directory configured |
Cloudflare now points new static sites here; static asset requests are free and unlimited (pricing) |
| Cloudflare Pages | Yes, on all plans | Connect Git or upload a folder | Still supported; 500 deploys a month on Free |
| Netlify | Yes, credit-based Free plan | Drag a folder onto Netlify Drop, connect Git, or CLI | Deploys and bandwidth use credits from a monthly allowance |
| Vercel | Yes, Hobby plan | Connect Git or npx vercel |
Hobby has usage caps; Pro is positioned for professional and business use |
This lesson uses GitHub Pages as the main path because your code is already on GitHub from Lesson 8.
Deploys are public
Once deployed, anyone with the URL can see your files, including every comment and any secret you forgot. That is why Lesson 11 came first.
Walkthrough
Step 1: Pre-launch checklist
Ask a fresh session for help, then verify each item yourself:
Help me run a pre-launch check on this static site. Check and report (do
not change anything):
- all file references in index.html are relative and match real files
(case-sensitive, because web servers are)
- no console.log debugging left behind
- no secrets, API keys or personal data in any file
- the page has a <title>, a meta description, lang and viewport
- no external scripts, and the CSP matches what the page loads
- node --test passes
Then by hand:
node --testpasses.- App works through
http://localhost:8000with Console open: no red errors. - Works at phone width, in dark mode, with keyboard only.
- Habits survive a refresh.
git statusis clean and everything is pushed:git push.
Case sensitivity trap: your Mac or Windows PC may treat App.js and app.js as the same file; most web servers do not. Make sure the names in <script src> and <link href> match exactly.
Step 2: Choose what to publish
GitHub Pages can publish from the repository root or from a /docs folder on a branch. If your index.html is at the root of your repository (as in your tiny-habits repo), publish from the root. If it is in a subfolder like project/, either move it or use a GitHub Actions workflow. For this course, the root is simplest.
Step 3: Turn on GitHub Pages
Follow GitHub’s guide to creating a GitHub Pages site. In short:
- Open your
tiny-habitsrepository on GitHub. - Go to Settings, then Pages.
- Under “Build and deployment”, choose Deploy from a branch.
- Pick branch
mainand folder/ (root). Save. - Wait a minute or two. The Pages settings show your URL, usually
https://YOUR-USERNAME.github.io/tiny-habits/.
Your repository must be public for Pages on a free GitHub account.
Step 4: Check the live site
Open the URL.
- Does the app load? Open the Console: any errors?
- Add a habit, refresh. Still there? (The live site has its own localStorage, separate from
localhost.) - Open it on your phone.
- Run the WAVE accessibility checker on the live URL and look at what it flags. Fix real issues in small commits.
- Run the W3C Markup Validator on the URL.
If you see a 404 page, wait another minute, then check that index.html is at the root of the branch you selected and the filename is lowercase.
Step 5: Ship an update
The deploy loop is now: change, test, commit, push.
Add a small footer: "Made while learning web development with AI." Change
only index.html and styles.css. Run node --test afterwards.
Review the diff, then:
git commit -am "Add footer"
git push
Within a minute or two the live site updates. If an update breaks the live site, use git revert <commit> and push: the site goes back to the previous version.
Step 6 (optional): Deploy to Cloudflare or Netlify instead
Netlify Drop, no command line: open app.netlify.com/drop, sign in, and drag your project folder onto the page. You get a URL in seconds. Good for a quick demo; connect Git later for automatic updates.
Cloudflare Workers static assets: create a wrangler.jsonc file in your project root (see the static assets docs):
{
"name": "tiny-habits",
"compatibility_date": "2026-12-01",
"assets": {
"directory": "./"
}
}
Then:
npx wrangler deploy
Because the assets directory here is the whole project folder, add a .assetsignore file next to index.html so only the site files are uploaded. It uses the same format as .gitignore:
.git
.wrangler
node_modules
tests
wrangler.jsonc
package.json
AGENTS.md
CLAUDE.md
SPEC.md
.env*
Wrangler asks you to log in the first time. Read each prompt. For larger projects, a cleaner layout is a dedicated public/ folder containing only the site files; ask your agent to set that up if you like. Check the Wrangler install docs if npx wrangler gives errors.
Remember from Lesson 11: deploy commands publish to the internet. Read them before approving, whether you or the agent runs them.
Step 7: Share it
- Put the live URL in your repository’s “About” box on GitHub and in your
README.md. - Add a screenshot to the README.
- Write two or three sentences about what you built and what you learned.
- Send the link to one person and ask them to try adding a habit on their phone. Watch what confuses them; that is your next feature list.
Step 8: Plan your next project
Take the idea you wrote down in Lesson 1’s assignment. Write a SPEC.md using the template in the course README. Then plan it in steps that map to this course:
| Course lesson | Your next project step |
|---|---|
| 3 | HTML structure |
| 5 | Styles and accessibility |
| 6 | Core interaction, logic in a pure module |
| 7 | Saving data |
| 9 | Tests for the logic |
| 11 | Security pass |
| 12 | Deploy |
Start a fresh session with:
Read SPEC.md. We'll build this in small steps with a plan before each one.
Create AGENTS.md first with rules similar to my last project: plain HTML,
CSS and JS, pure logic separate from DOM code, textContent only, tests with
node --test, ask before installs or deletes. Show me AGENTS.md before
writing any app code.
What good output looks like
- Your app is live at a public HTTPS URL.
- No console errors on the live site.
- The live site passes basic WAVE and validator checks, or you know why not.
- An update you pushed appeared on the live site.
- Your README has the live link, a screenshot and a short write-up.
- You have a
SPEC.mdfor your next project.
Checklist
- Pre-launch checklist complete.
- GitHub Pages (or another host) is serving the app.
- Tested the live site on desktop and phone.
- Shipped one update through commit and push.
- README updated with the live URL.
- Shared the link with at least one person.
- Next project spec written.
Mini-quiz
- What makes Tiny Habits a static site?
- Your site works locally but the live site shows the page without styles. What is a likely cause?
- Do habits you added on
localhostappear on the live site? Why? - How do you roll back a bad update on GitHub Pages?
- Why does Lesson 11 come before Lesson 12?