Reusable workflow that installs npm dependencies and runs the project build script.
Replace
<current-sha>with the current SHA from the root README.
on: [push, pull_request]
jobs:
build:
uses: orangitfi/platform-tooling/.github/workflows/node-build.yml@<current-sha>jobs:
build:
uses: orangitfi/platform-tooling/.github/workflows/node-build.yml@<current-sha>
with:
working-directory: ./frontend
build-command: build:prodjobs:
security:
uses: orangitfi/platform-tooling/.github/workflows/node-security-scan.yml@<current-sha>
build:
needs: security
uses: orangitfi/platform-tooling/.github/workflows/node-build.yml@<current-sha>
test:
needs: build
uses: orangitfi/platform-tooling/.github/workflows/node-test.yml@<current-sha>| Input | Default | Description |
|---|---|---|
working-directory |
. |
Directory containing package.json |
build-command |
build |
npm script name to run (npm run <build-command>) |
- Checks out the repository
- Runs
npm ci— installs exact versions frompackage-lock.jsonwith no lockfile modification - Runs
npm run <build-command>
- Verifies the project compiles on every PR — catches TypeScript errors, missing imports, and broken Vite/webpack configs before they reach main
- Using
npm ci(notnpm install) ensures the lockfile is respected and no unexpected dependency upgrades occur in CI
npm cirequirespackage-lock.jsonto be committed. If it is missing the step fails immediately.- For Next.js projects,
npm run buildalso generates the.nextbuild output. If you want to reuse this output in a deploy job, consider uploading it as an artifact. - TypeScript compile errors appear in the build output. If you want them as individual annotations on the PR diff, configure your TypeScript build to output structured diagnostics.