A useful CI pipeline recreates a clean environment and quickly shows whether a change passes linting, type checks, tests, and the production build.
Minimum steps
Checkout the code, use setup-node with a pinned version, cache the npm download store, run npm ci, then lint, typecheck, test, and build. npm ci follows the lockfile and fails on manifest drift.
Expand carefully
Use a matrix for supported Node versions, split jobs for useful parallelism, upload reports on failure, add timeouts, and cancel obsolete runs for the same pull request.
Workflow security
Minimize token permissions, pin trusted actions, and never expose secrets to untrusted pull-request code. Deploy only after required checks pass.




No comments yet. Be the first to share your thoughts.