GitHub Actions CI Workflow Builder (Node.js)

Generate a Node.js CI workflow with test, lint, and build steps

Create a GitHub Actions CI workflow YAML for Node.js projects with a multi-version test matrix, npm, yarn, or pnpm dependency caching, and lint, test, and build jobs. Copy a ready-to-commit .github/workflows file built in your browser.

Where does this file go?

Save it as .github/workflows/ci.yml in the root of your repository. GitHub automatically detects any YAML file under .github/workflows and runs it on the events you configure, here push and pull_request to your chosen branch.

A GitHub Actions CI workflow builder for Node.js that generates a valid .github/workflows/ci.yml. Pick the Node versions to test, your package manager, and which jobs to run, and it produces a workflow with a version matrix, dependency caching, and lint, test, and build steps.

How it works

The workflow triggers on push and pull_request to the branch you choose. It defines a single build job on ubuntu-latest with a strategy.matrix.node-version listing your versions, so the job runs once per version in parallel. fail-fast: false keeps the other versions running even if one fails, so you see every failure at once.

Each run checks out the code, sets up Node with actions/setup-node@v4 (which keys the dependency cache off your lockfile via cache: npm|yarn|pnpm), installs with the reproducible command for your package manager (npm ci, yarn install --frozen-lockfile, or pnpm install --frozen-lockfile), then runs the lint, test, and build scripts you enabled. For pnpm it also adds the pnpm/action-setup step that the cache wiring requires.

Tips and notes

  • The script names (lint, test, build) must exist in your package.json. Untick any step whose script you do not have, or the job will fail on a missing script.
  • The matrix is cheap — testing on the oldest and newest Node versions you support (for example 18 and 22) catches most compatibility issues without burning extra minutes.
  • For pnpm, the workflow pins pnpm/action-setup@v4 with a version; bump it to match the packageManager field in your package.json if you have one.
  • To publish or deploy on success, add a second job with needs: build so it only runs after the matrix passes.