-
Notifications
You must be signed in to change notification settings - Fork 250
38 lines (36 loc) · 960 Bytes
/
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
name: Cache
on:
workflow_dispatch:
schedule:
- cron: '0 4 * * *'
jobs:
refresh:
runs-on: ubuntu-latest
steps:
- if: >
github.event_name == 'schedule'
name: 🧹🪣 Delete caches
run: gh cache delete --all
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
- name: ⬇️ Checkout package.json
uses: actions/checkout@v4
with:
sparse-checkout-cone-mode: false
sparse-checkout: |
package.json
- id: install
name: 📥 Install deps
run: yarn
env:
HUSKY_SKIP_INSTALL: true
- if: >
steps.install.outcome == 'success'
name: ♻️ Save node_modules
uses: actions/cache/save@v4
with:
path: |
yarn.lock
node_modules
key: ${{ hashFiles('package.json') }}-${{ hashFiles('yarn.lock') }}