-
Notifications
You must be signed in to change notification settings - Fork 30
38 lines (36 loc) · 1.22 KB
/
ci.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: Node.js CI
on:
push:
branches: [develop]
pull_request:
types: [synchronize, opened, reopened]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
# Use same version of node for netlify and CI build
node-version-file: '.nvmrc'
cache: 'npm'
- name: Docusaurus cache
if: ${{ github.ref != 'refs/heads/develop' }}
uses: actions/cache@v4
with:
path: |
.docusaurus
node_modules/.cache
key: ${{ runner.os }}-docusaurus-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.[jt]s', '**/*.[jt]sx') }}-${{ hashFiles('**/*.md', '**/*.mdx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-docusaurus-${{ hashFiles('**/package-lock.json') }}-
${{ runner.os }}-docusaurus-
- run: npm ci
- name: Lint 🧶
run: npm run lint
- name: Build 🏗️
run: npm run build
# Build is separate deployment on develop branch
if: ${{ github.ref != 'refs/heads/develop' }}