ci(actions): fix node_modules caching

https://github.com/actions/setup-node/issues/416
This commit is contained in:
Bobby 2022-05-06 22:21:56 +07:00
parent b17ea6c8bd
commit 0804ce9185
No known key found for this signature in database
GPG Key ID: 941839794CBF5A09

View File

@ -10,6 +10,9 @@ on:
- 'src/**/*.scss' - 'src/**/*.scss'
- 'src/versions.json' - 'src/versions.json'
env:
NODE_VERSION: 16
jobs: jobs:
build: build:
name: Rebuild client assets and bump v1 version string name: Rebuild client assets and bump v1 version string
@ -20,11 +23,18 @@ jobs:
- name: Use Node.js - name: Use Node.js
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
node-version: '16.x' node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'
- name: Cache node_modules
uses: actions/cache@v2
id: cache-nodemodules
with:
path: node_modules
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-nodemodules-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies - name: Install dependencies
run: yarn install if: steps.cache-nodemodules.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile --non-interactive
- name: Update browserslist/caniuse-lite - name: Update browserslist/caniuse-lite
run: npx browserslist@latest --update-db run: npx browserslist@latest --update-db