0Pricing
React Academy · Lesson

GitHub Actions CI/CD for React

Automate lint, test, build, and deploy steps in a GitHub Actions workflow on every push.

What Is GitHub Actions?

GitHub Actions is a CI/CD platform built into GitHub. Define workflows in YAML files under .github/workflows/ that run on push, pull request, or schedule events.

Basic CI Workflow

A minimal workflow that installs dependencies, runs linting, and runs tests on every push and pull request.

# .github/workflows/ci.yml
name: CI

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
          cache: 'npm'
      - run: npm ci
      - run: npm run lint
      - run: npm test -- --coverage

All lessons in this course

  1. Deploying to Vercel: Zero-Config & Preview URLs
  2. Hosting a React SPA on AWS S3 & CloudFront
  3. Dockerizing a React/Next.js App
  4. GitHub Actions CI/CD for React
← Back to React Academy