Skip to content

Add build cache job (#20) #8

Add build cache job (#20)

Add build cache job (#20) #8

Workflow file for this run

name: Code Quality Check
on:
pull_request:
push:
branches: [main, master]
workflow_dispatch:
jobs:
eslint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run ESLint
run: npm run lint
build:
runs-on: ubuntu-latest
needs: eslint
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Cache build output
id: cache-build
uses: actions/cache@v4
with:
path: |
dist
build
.next
key: ${{ runner.os }}-build-${{ hashFiles('package-lock.json') }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-build-${{ hashFiles('package-lock.json') }}-
${{ runner.os }}-build-
- name: Run Build
if: steps.cache-build.outputs.cache-hit != 'true'
run: npm run build