Skip to content

Cache NPM Workflow

Cache NPM Workflow #1

Workflow file for this run

name: Cache Workflow
on: workflow_dispatch
permissions:
contents: write
jobs:
cache-setup:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache Node Modules
id: cache-npm
uses: actions/cache@v4
env:
cache-name: cache-npm
with:
path: ~/.npm
key: ${{ runner.os }}-${{env.cache-name}}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-${{env.cache-name}}-
${{ runner.os }}-
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
name: List the state of node modules
continue-on-error: true
run: npm list
- name: Install Dependencies
run: npm install