Intro

Build and deploy a simple website using HTML, CSS, and JavaScript, with deployment to GitHub Pages Vercel

9/5/25 Updated for Vercel- See deployments

Web Dev 101- Build & Deploy Your First Website by OC Robotics

📎TODO

  • Build an HTML structure
  • Push to GitHub
  • Deploy to GitHub Pages Vercel
  • Style it with CSS
  • (Optional) Add JavaScript

Setup Project

Create project

  • Create a project folder and cd into it
mkdir -p webdev_ws & cd webdev_ws

Sync Project with GitHub

  • Create a repository on GitHub
  • push your local repo to GitHub

Create a new branch

  • Create a webdev101 branch and switch to it
git checkout -b webdev101
  • Open project in VS Code
code .

Add HTML- The Structure

HTML (HyperText Markup Language) is used to define content structure (headings, paragraphs, links, etc.).

  • Commit your changes
git add .
git commit -m "Added index.html"

Preview the page with VS Code Live Server

  • Install and run the Live Server extension in VS Code

    • Easily open the HTML file in a web browser and refresh automatically
  • View page by opening the URL in the browser

http://127.0.0.1:5500/index.html

picture 2

Deploy your site

GitHub Pages

Note

This exercise focuses on Vercel. See GitHub Pages if you wish to deploy using that method instead

Vercel

Deploy to Vercel from GitHub

  • Go to vercel.com and sign in with GitHub
  • Import project- Click “Add New → Project” and select your repo
  • If Vercel doesn’t auto-detect Vite, set the following options:
    • Framework: Vite
    • Build command: npm run build
    • Output directory: dist
  • Click “Deploy”
  • Your site will be live on a *.vercel.app domain

Trigger a Preview Deployment

  • Push commits on the webdev102 branch to GitHub to create a Preview Deployment whenever you push to this branch
git push origin webdev102

Add CSS- The Style

CSS (Cascading Style Sheets) is used to control layouts, colors, fonts, etc.

  • Create style.css

picture 1

  • Commit and push your changes
git add .
git commit -m "Added style.css"
git push origin webdev101

Add JavaScript— Interactivity

JavaScript makes your site interactive (e.g., having complex animations, clickable buttons, popup menus, etc.)

  • First, Update index.html file to add the following code inside the <body> tag
  • Create script.js
  • Commit and push your changes
git add .
git commit -m "Added button functionality"
git push origin webdev101

Challenge

  • Turn the button into a counter (Hint: Create counter variable in javascript)

Final Checklist

📎Final Checklist

  • âś… Build an HTML structure
  • âś… Push to GitHub
  • âś… Deploy to GitHub Pages Vercel
  • âś… Style it with CSS
  • âś… (Optional) Add JavaScript

Continue learning

Next: Web Dev 102- React + Vite