Open source · Case study
react-ci-cd-template
A React, TypeScript and Vite starter whose pipeline tests, scans, builds once, deploys to GitHub Pages and smoke-tests the live URL.
- 100%test coverage
- 1build, reused for deploy
- Live demodeployed on every merge
The problem
Most starter templates stop at a build that passes. Teams I coached kept rebuilding the same delivery pipeline from scratch, and usually left out the parts that make a release safe.
What I built
- A GitHub Actions pipeline with lint, Vitest with coverage, a dependency security scan and a production build on every push.
- A deploy job that publishes to GitHub Pages on merges to main, then fetches the live URL and fails if the app is not served.
- A README that explains each stage and how to roll back.
Decisions and tradeoffs
Build once, deploy the tested bundle
The deploy job publishes the exact artifact the build job produced and verified. Rebuilding at deploy time would mean shipping something that was never tested.
A smoke test is part of the deploy
The pipeline is not green until the live URL serves the app. A deploy that succeeds but serves a blank page fails the run.
No per-fork configuration
The base path is derived from the repository name, so anyone who uses the template gets a working deployment after one settings change.
Rollback is a revert
There is no separate rollback tool to maintain. Reverting the commit runs the same pipeline and redeploys the previous version, with the same checks.
Results
- 100% test coverage reported to Codecov.
- Deployed to a live demo on every merge to main, verified by the smoke test.