A dependable JavaScript or TypeScript CI/CD pipeline should make failures visible before merge, produce repeatable build output, and give the team a safe path to deployment and rollback. This practical checklist covers the checks to run, the decisions to document, and the points to revisit as your repository and toolchain change.
Overview
CI/CD is not just a deployment button. It is a sequence of automated quality gates that answers three questions: can the project be installed reproducibly, does the code meet its technical checks, and can the resulting application be deployed and operated safely?
The exact tools may vary. A project might use npm, pnpm, or another package manager; GitHub Actions, GitLab CI, or a hosted build service; and a frontend platform, container registry, or cloud runtime. The pipeline design remains broadly similar. Keep the workflow close to the commands developers run locally, pin the runtime and dependency inputs where practical, and make each failure easy to reproduce.
A useful baseline is:
- Install dependencies from the lockfile.
- Check formatting and lint rules.
- Run TypeScript or other static type checks.
- Run unit and integration tests.
- Run end-to-end tests where the application warrants them.
- Audit dependencies and scan the build or image as appropriate.
- Build a production artifact.
- Publish a preview for review, then deploy through a controlled release path.
For browser-heavy applications, pair this checklist with a defined browser-testing strategy. The end-to-end browser testing workflow can help you decide which user journeys deserve coverage rather than attempting to test every interaction in every pipeline run.
Checklist by scenario
Every pull request
- Use the intended runtime: select a supported Node.js LTS line for the repository and declare it in the project configuration and CI setup. Avoid allowing the runner's default version to determine behavior.
- Install deterministically: use the package manager's lockfile-enforcing command. For npm this commonly means
npm ci; use the equivalent immutable or frozen-lockfile mode for other package managers. Fail if the lockfile and manifest disagree. - Restore only safe caches: cache package-manager downloads or other reproducible intermediates, but never use a cache as a substitute for installing from the lockfile.
- Format and lint: run repository scripts such as
format:checkandlint. Checks should be non-mutating in CI so a passing job reflects the committed files. - Type-check: run the TypeScript compiler in a no-emit mode, or the equivalent check for the project. Keep type checking separate from the production build when that makes failures easier to diagnose.
- Test: run unit and integration tests with an explicit, non-watch command. Upload useful reports or coverage artifacts when the team uses them for review.
- Inspect dependencies: run the repository's dependency audit and secret-detection checks. Treat findings according to a documented severity policy instead of automatically ignoring every warning.
- Build: create the application or package output from a clean workspace. A successful development server is not evidence that the production build works.
Before merging or creating a release
- Require the essential checks to pass before merging into the protected branch.
- Run a wider test matrix when the change affects supported Node.js versions, operating systems, browsers, or package-manager behavior.
- Verify that generated files, migrations, API schemas, and package metadata are handled intentionally.
- Build the same commit that will be released. Do not silently rebuild from a moving branch after approval.
- Record the release identifier, commit, artifact, and environment so an operator can determine exactly what is running.
For API repositories, add contract or schema validation to the merge path. An OpenAPI workflow is useful when request and response changes need to be reviewed alongside implementation changes.
For preview deployments
- Deploy pull requests to an isolated URL when the platform supports it.
- Use non-production credentials and data. Preview environments should not gain broad access to production systems merely to make a test pass.
- Show the preview URL and relevant commit in the pull request.
- Run a short smoke test against the deployed result, including page loading, authentication boundaries, and a critical user action.
- Define how preview resources expire or are removed so abandoned branches do not accumulate infrastructure.
For production deployment
- Keep secrets in the CI provider or deployment platform's secret store, not in source code, logs, artifacts, or client-side configuration.
- Separate build-time values from runtime secrets. Anything bundled into browser JavaScript should be treated as public.
- Use an approval or environment protection step where the application's risk requires it.
- Run post-deployment smoke checks and monitor errors, availability, and important application paths.
- Document rollback: identify the previous known-good artifact, define who can trigger the rollback, and state how database or API compatibility is handled.
Monitoring should be part of the release workflow, not an afterthought. See the web error monitoring setup and triage workflow for a practical way to connect deployment changes with runtime failures.
What to double-check
Before calling a pipeline reliable, inspect the edges where local development and CI commonly diverge:
- Lockfile ownership: confirm which package manager owns the lockfile and prevent accidental edits by another tool.
- Environment parity: compare Node.js versions, operating-system assumptions, environment variables, database services, and browser dependencies between local runs and CI.
- Monorepo scope: ensure a change in a shared package triggers all affected builds and tests, while unrelated packages are not needlessly rebuilt.
- Test isolation: use disposable databases, unique test data, and cleanup steps. Tests that depend on order or a shared remote service will eventually produce misleading failures.
- Artifact integrity: make sure the deployment job uses the tested artifact or repeats the exact build inputs. A passed test followed by a different untested build weakens the entire gate.
- Migration safety: deploy schema changes in a backward-compatible sequence when old and new application versions may overlap. Review database migration practices in the database migration workflow reference.
- Failure visibility: retain enough logs, test reports, screenshots, and traces to diagnose a failure without rerunning the job repeatedly.
Keep commands in package scripts where possible. A CI file should orchestrate the project rather than contain a second, undocumented build system. Developers should be able to run the same checks locally with a small number of documented commands.
Common mistakes
- Testing only after deployment: production smoke tests are valuable, but they cannot replace unit, integration, and build checks before release.
- Using floating inputs: unpinned action references, runtime versions, container bases, or dependency ranges can make an old commit behave differently later. Choose an update policy and review changes deliberately.
- Making every job blocking: a useful informational check can become noise if it prevents merges without an owner or clear remediation path. Separate required gates from advisory signals.
- Leaking secrets through debugging: verbose shell output, failed commands, test snapshots, and uploaded artifacts can expose credentials or tokens. Mask values and avoid printing environments wholesale.
- Ignoring flaky tests: rerunning until green hides a reliability problem. Track flaky tests, isolate their cause, and give them an explicit owner and deadline.
- Skipping rollback design: a deployment is incomplete if the team knows how to release but not how to recover. Test the rollback path at a level appropriate to the application's risk.
- Over-caching: stale build outputs can create false positives. Start with dependency caches, use clear cache keys, and provide a deliberate way to bypass or refresh them.
If the application is containerized, include image construction and scanning in the release path. The guide to production Docker images covers multi-stage builds, security checks, and size considerations that complement this CI/CD checklist.
When to revisit
Review the pipeline before seasonal planning or release-process reviews, and whenever the inputs change. At minimum, revisit it when the project moves to a new Node.js LTS line, changes package managers, adopts a new framework or bundler, adds a workspace or service, changes its CI provider, or introduces a new deployment target.
Also review the workflow after a production incident, a dependency compromise, repeated flaky tests, a major build-time slowdown, or a rollback that was difficult to perform. These events reveal gaps that a green pipeline may not show.
Use this short maintenance routine:
- Run every required check from a clean environment and record the duration.
- Confirm the runtime, action, container, and dependency update policies are still intentional.
- Remove obsolete secrets, permissions, jobs, and caches.
- Trigger a preview deployment and verify its isolation.
- Exercise the release smoke test and document the rollback command or procedure.
- Compare recent failures with the checklist and add a gate only when it addresses a demonstrated risk.
A good pipeline is not the longest one. It is a maintained set of developer tools and safeguards that gives each commit a reproducible path from source to verified artifact to observable deployment.