Skip to content

Cache node_modules between workflow runs #5

@nev-offload

Description

@nev-offload

Problem

npm install runs on every workflow invocation, downloading all dependencies from scratch. This adds ~15-30s to every run and wastes bandwidth.

Expected behavior

Use GitHub Actions cache to persist node_modules between runs.

Implementation notes

  • Use actions/cache with package-lock.json hash as the cache key
  • Alternatively, use actions/setup-node with cache: npm (simpler)
  • Example:
    - uses: actions/setup-node@v4
      with:
        node-version: 20
        cache: npm
  • Consider pre-building and bundling the action so no install step is needed at all (esbuild/ncc)
  • @vercel/ncc can compile the entire action into a single file — eliminates npm install entirely

Priority

P2 — Nice optimization but not blocking functionality.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions