Step 7 — CI/CD with GitHub Actions

What This Step Is About

CI/CD stands for Continuous Integration and Continuous Deployment. CI means every code change is automatically validated (linted, tested, built) before it can be merged. CD means a successful change on the main branch is automatically deployed to production. Together, they mean you never manually deploy code and you catch problems before they reach users.

This step sets up a GitHub Actions workflow that runs on every push and pull request.


Concepts and Tools

Continuous Integration (CI)

The discipline of merging code changes frequently and validating each change automatically. The key idea: find problems as early as possible, when they are cheapest to fix. A broken build that fails in 2 minutes of CI is infinitely cheaper to fix than a production outage discovered by users 3 days after a deploy.

For this project, CI runs:

Resources:

Continuous Deployment (CD)

The practice of automatically deploying every successful build on the main branch to production. When CI passes, the code goes live without a human having to click "deploy." This requires trust in your test suite and a fast rollback strategy.

For this project, CD deploys the client to Vercel and the server to Railway on every merge to main.

Resources:

GitHub Actions

GitHub Actions is GitHub's built-in CI/CD platform. You define workflows in YAML files in the .github/workflows/ directory of your repository. GitHub runs these workflows on its own servers (called runners) in response to events like pushes and pull requests.