-
Notifications
You must be signed in to change notification settings - Fork 0
26 lines (26 loc) · 1.05 KB
/
cache-node-modules.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
name: cache-node-modules
on: pull_request
jobs:
cache-node-modules:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
# Looks for changes to the `yarn.lock` file, though it could just
# as easily look for changes in `package-lock.json` file, if you
# are using npm instead of yarn.
#
# If `yarn.lock` has changed, it will reinstall dependencies and
# cache them for later.
#
# If `yarn.lock` has not changed, it will just reuse the existing
# installed dependencies in `node_modules`.
- name: Cache node_modules
id: node-modules-cache
uses: actions/cache@v2
with:
path: '**/node_modules'
key: node-modules-cache-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile