Skip to content

feat: initialize Docusaurus documentation and automate deployment via… #3

feat: initialize Docusaurus documentation and automate deployment via…

feat: initialize Docusaurus documentation and automate deployment via… #3

Workflow file for this run

name: Deploy Documentation
on:
push:
branches: [main]
paths:
- 'docs/**'
- '.github/workflows/deploy-docs.yml'
workflow_dispatch:
concurrency:
group: "pages"
cancel-in-progress: true
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
env:
DOCUSAURUS_NO_PROGRESS: true
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
cache-dependency-path: docs/package.json
- name: Cache node_modules
uses: actions/cache@v4
id: cache-node-modules
with:
path: docs/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('docs/package.json', 'docs/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm install
working-directory: docs
- name: Build website
run: npm run build
working-directory: docs
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/build
publish_branch: docs
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
commit_message: 'docs: deploy documentation [skip ci]'