GitHub Pages
& Workflows
Deploy your first website for free and automate tasks without a server — beginner-friendly, no experience needed.
GitHub Pages
What is GitHub Pages?
GitHub Pages is free website hosting, built into every GitHub repository. You push your HTML/CSS files to a repo, flip a switch in settings, and GitHub gives you a live public URL — no server, no cost, no configuration.
100% Free
Free hosting forever. No credit card, no hidden limits for static sites.
Free Domain
You get username.github.io automatically. You can also attach a custom domain.
Instant Deploy
Push a commit -> site updates in under 2 minutes. No FTP, no SSH, no control panel.
Recruiter-Ready
Share one link on your resume. Employers can see your live projects immediately.
//Two Types of GitHub Pages Sites
- Repo name must be exactly
username.github.io - Lives at
https://username.github.io - One per GitHub account
- Your main portfolio / about page
- Any repo name works
- Lives at
https://username.github.io/repo-name - Unlimited project sites
- For demos, class projects, tools
Hosting a Personal Portfolio Site
This creates your root site at https://username.github.io. This is the link you put on your resume and LinkedIn.
git push new changes, GitHub automatically rebuilds and redeploys your site. You never need to touch the settings again.Hosting a Project Site
Any existing repo can become a website. Use this for project demos, data visualizations, or assignment submissions.
index.html exists at the root of the repo (not inside a subfolder). GitHub looks for it there first.What You Can & Can't Host
- HTML, CSS, JavaScript
- Images, videos (under 100MB)
- Interactive charts (Plotly JS, Chart.js, D3)
- Forms that post to external services (Formspree)
- React/Vue apps that build to static files
- Documentation sites (MkDocs, Docusaurus)
- Markdown files (auto-rendered)
- Python / Flask / Django servers
- Node.js / Express backends
- PHP, Ruby, Java
- Databases (PostgreSQL, MySQL)
- Server-side rendering
- Files over 100MB (use Git LFS)
- Private / password-protected pages (free plan)
jupyter nbconvert --to html notebook.ipynb) and host the result on Pages. Instant shareable analysis report, no server needed.GitHub Actions & Workflows
What is a Workflow?
A GitHub Actions workflow is a set of automated tasks that run on GitHub's servers whenever something happens to your repo — like pushing code, opening a PR, or on a schedule.
Think of it as a robot teammate: every time you push code, the robot wakes up, runs your tests, and deploys your site — without you touching anything.
Triggered Automatically
Runs when you push, merge, open a PR, or on a schedule you define.
Runs on GitHub Servers
No local setup. GitHub spins up a fresh Ubuntu machine and runs your steps.
Free for Public Repos
2,000 minutes/month free on private repos too. Public repos get unlimited minutes.
//Key Vocabulary
| Term | What it is | Analogy |
|---|---|---|
| Workflow | The entire automation defined in one YAML file | The full recipe |
| Event / Trigger | What causes the workflow to run (push, PR, schedule) | The alarm clock |
| Job | A group of steps that run on the same machine | One worker's task list |
| Step | A single command or action within a job | One instruction in the recipe |
| Runner | The virtual machine GitHub spins up to run your job | The kitchen where it runs |
//How It All Fits Together
Your First Workflow File
Workflows live in a special folder in your repo: .github/workflows/. Each .yml file inside is one workflow. GitHub picks them up automatically — no registration needed.
//Anatomy of a Workflow File
Let's break down a simple workflow that says hello every time you push:
//Common Trigger Events
Auto-Deploy Pages with Actions
This is the most practical beginner workflow: every time you push to main, your GitHub Pages site rebuilds and redeploys automatically. No manual clicks in settings.
//Where to Monitor Your Workflow
After pushing, click the Actions tab at the top of your repo. You'll see a live log of every step — green checkmarks mean success, red X means something failed. Click any step to see its output.
Beginner Workflow Recipes
Copy-paste these into your own repos. Each is self-contained and beginner-friendly.
//Recipe 1 — Greet on PR (Print a message)
//Recipe 2 — Run Python Tests on Every Push
//Recipe 3 — Scheduled Daily Message (Cron)
0 9 * * * — every day at 9 AM UTC0 9 * * 1-5 — weekdays only at 9 AM*/30 * * * * — every 30 minutes0 0 * * 0 — every Sunday at midnightUse crontab.guru to generate cron expressions interactively.
//Quick Summary — Workflow Cheatsheet
docs.github.com/actions — Full official documentation
github.com/marketplace/actions — 20,000+ pre-built actions to reuse
crontab.guru — Visual cron expression builder
This guide is part of the Mastering Version Control workshop.
View the main Git Workshop guide