- use
actions/checkoutto checkout your repo under$GITHUB_WORKSPACE - use
actions/setup-nodewith node-version - use
iCHEF/npm-install-with-cache-actionwith inputs if needed
npm-token- defaults to"". Provide auth token if your project dependency contains private packages.skip-cache- defaults to"false". Set it to"true"to skip cache steps.engine- default to"npm". Also supports"yarn".args- defaults to"", will be passed to package manager when running install.
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Install packages with cache
uses: iCHEF/npm-install-with-cache-action@v2
with:
npm-token: ${{ secrets.NPM_TOKEN }}
engine: npm
args: --force