name: docs
permissions:
contents: read
pages: write
id-token: write
on:
push:
branches: [main]
paths: ['docs/**', '.github/workflows/docs.yml']
pull_request:
paths: ['docs/**', '.github/workflows/docs.yml']
workflow_dispatch:
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
name: build docusaurus site
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: lts/*
cache: npm
cache-dependency-path: docs/package-lock.json
- run: npm ci
working-directory: docs
- run: npm run build
working-directory: docs
- uses: actions/configure-pages@v6
- uses: actions/upload-pages-artifact@v4
with:
path: docs/build
deploy:
name: deploy to GitHub Pages
needs: build
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v5