← Lesson
BitWithBite
Git & GitHub · Quick Reference

Lesson 8 — GitHub Actions & CI/CD Cheat Sheet

Git & GitHub
In one line: CI/CD stands for Continuous Integration / Continuous Deployment. It's the practice of automatically running tests and deploying code every time changes are pushed — removing the...

Key Ideas

1What is CI/CD?. CI/CD stands for Continuous Integration / Continuous Deployment. It's the practice of automatically running tests and deploying code every time changes are pushed — re...
2GitHub Actions Concepts. GitHub Actions is GitHub's built-in automation platform. You write YAML files that describe what should happen and when. GitHub runs them on managed virtual machines c...
3Your First Workflow. Create a file at .github/workflows/hello.yml in your repository. GitHub automatically detects it and runs it when the trigger fires.
4Real CI Pipeline — Node.js. Here's the standard CI workflow used by Node.js projects worldwide. It checks out code, installs dependencies, and runs tests automatically on every push and PR.
5Automated Deployment to GitHub Pages. GitHub Pages hosts static sites for free directly from your repository. Combined with Actions, you can auto-deploy on every push to main — no FTP, no manual uploads.

Code Examples

# Workflow name — shown in GitHub UI name: Hello World # Trigger: run on every push to any branch on: push jobs: greet: # The virtual machine to run on runs-on: ubuntu-latest steps: # Step 1: check out your repository code - use...
name: CI on: push: branches: [main] pull_request: branches: [main] jobs: test: runs-on: ubuntu-latest steps: # 1. Check out repository code - uses: actions/checkout@v4 # 2. Set up Node.js environment - uses:...
name: Deploy to GitHub Pages on: push: branches: [main] # Allow GitHub Pages deployment permissions: contents: read pages: write id-token: write jobs: deploy: environment: name: github-pages url: ${{ steps.deployment.outputs...