cache/.github/workflows/cache.yml

29 lines
647 B
YAML

name: Cache
on:
pull_request:
branches:
- master
jobs:
build:
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Restore npm cache
uses: ./
id: cache
with:
path: |
node_modules
dist
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('salt.txt') }}
- run: npm install
if: steps.cache.outputs.cache-hit != 'true'
- run: npm run build
if: steps.cache.outputs.cache-hit != 'true'