Skip to content

GitHub action to efficiently set up any project using node environment with the package manager and node_modules cache configured.

Notifications You must be signed in to change notification settings

usafder/setup-node-with-cache

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Setup Node with Cache

GitHub action to efficiently set up your project that is using the node environment. You now don't have to write down all those boring steps for setting up your project as this action will take care of that for you!

Example Usage:

name: CI
on:
  push:
    branches:
      - main

jobs:
  lint-and-test:
    runs-on: ubuntu-latest
    steps:
      - uses: usafder/setup-node-with-cache@v1.0.0
      - run: npm run lint
      - run: npm run test

As you can see in the example above, your workflow will become way too simpler now because you don't have to worry about defining all those steps like checking out the repo, setting up node or even downloading the dependencies as this action will handle all that for you. You now only need to define the steps that are to be executed after the installation of the dependencies.

By default it uses the node version of 18.0.0 but in case you wanna use a specific version of node (for eg. 18.14.2) then you can do so by defining the node version in your project's .nvmrc file like this:

18.14.2

OR

provide the NODE_VERSION input to this action as shown below:

name: CI
on:
  push:
    branches:
      - main

jobs:
  lint-and-test:
    runs-on: ubuntu-latest
    steps:
      - uses: usafder/setup-node-with-cache@v1.0.0
        with:
          NODE_VERSION: 18.14.2
      - run: npm run lint
      - run: npm run test

About

GitHub action to efficiently set up any project using node environment with the package manager and node_modules cache configured.

Topics

Resources

Stars

Watchers

Forks