Skip to content

Commit

Permalink
chore: add docusaurus cache to CI cache (#733)
Browse files Browse the repository at this point in the history
  • Loading branch information
hugo-vrijswijk authored Nov 30, 2023
1 parent 1ae6709 commit bd4ba9b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
18 changes: 17 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Node.js CI

on: [push, pull_request]
on:
push:
branches: [develop]
pull_request:
types: [synchronize, opened, reopened]

jobs:
build:
Expand All @@ -13,6 +17,18 @@ jobs:
# 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@v3
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
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,12 @@ jobs:
with:
path: |
.docusaurus
key: ${{ runner.os }}-docusaurus-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
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: Build 🏗️
run: npm run build
Expand Down

0 comments on commit bd4ba9b

Please sign in to comment.