Skip to content

Improve Caching

Improve Caching #322

Workflow file for this run

name: Node.js CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
types:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Cache node modules
uses: actions/cache@v4
with:
path: |
node_modules
~/.cache/yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install & Build
run: |
yarn --frozen-lockfile
yarn lint
yarn build
yarn verify
- name: Save Cache (Only if no match was found)
if: steps.yarn-cache.outputs.cache-hit != 'true'
uses: actions/cache@v4
with:
path: |
node_modules
~/.cache/yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}