Skip to content

add cache

add cache #38

name: Build and Deploy
on:
push:
branches:
- master
- feature/ci
pull_request:
branches:
- master
jobs:
# Build job
build:
# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
# Checkout code
- uses: actions/checkout@v3
# Set up node
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 'lts'
cache: 'npm'
# Install, build and run project
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build:ci
# - name: Test
# run: npm run test:ci
- name: Upload GitHub Pages artifact
if: success()
uses: actions/[email protected]
with:
name: dist/sudoku-app
# path: dist
# - name: Cache node modules
# uses: actions/[email protected]
# env:
# cache-name: cache-node-modules
# with:
# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-build-${{ env.cache-name }}-
# ${{ runner.os }}-build-
# ${{ runner.os }}-
# - name: npm install and npm run CI commands
# run: |
# npm i
# npm run test:ci
# npm run build:ci