Skip to content

Commit

Permalink
cache node modules and docusaurus build
Browse files Browse the repository at this point in the history
  • Loading branch information
yell0wsuit committed Aug 7, 2024
1 parent 789e095 commit 8316c62
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ on:
push:
branches:
- main
# Review gh actions docs if you want to further define triggers, paths, etc
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on

jobs:
build:
Expand All @@ -15,13 +13,30 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-node@v4
with:
node-version: 21
cache: npm
node-version: "21"

- name: Cache Node Modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm ci

- name: Cache Docusaurus Build
uses: actions/cache@v3
with:
path: .docusaurus
key: ${{ runner.os }}-docusaurus-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx', '**/*.md') }}
restore-keys: |
${{ runner.os }}-docusaurus-
- name: Build website
run: npm run build

Expand All @@ -34,12 +49,10 @@ jobs:
name: Deploy to GitHub Pages
needs: build

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
pages: write
id-token: write

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Expand Down

0 comments on commit 8316c62

Please sign in to comment.