forked from ppy/osu-wiki
-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (36 loc) · 1.17 KB
/
refresh-cache.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: refresh node_modules cache
on:
push:
branches:
- master
jobs:
cache-node-modules:
name: update cache
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
# meta/remark contains linked packages
sparse-checkout: meta/remark
- name: set up Node.js
id: setup-node
uses: actions/setup-node@v3
with:
cache: npm
node-version: 20
- name: check node_modules cache
id: cache-node-modules
uses: actions/cache/restore@v3
with:
path: node_modules
lookup-only: true
key: node-modules-${{ hashFiles('package-lock.json') }}-${{ steps.setup-node.outputs.node-version }}
- name: 'if cache is outdated: install node_modules'
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm ci
- name: 'if cache is outdated: save cache'
if: steps.cache-node-modules.outputs.cache-hit != 'true'
uses: actions/cache/save@v3
with:
path: node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}-${{ steps.setup-node.outputs.node-version }}