This repository was archived by the owner on Jul 11, 2026. It is now read-only.
ci: add GitHub Actions workflow to deploy documentation to GitHub Pages #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy Documentation | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'docs/**' | |
| - '.github/workflows/deploy-docs.yml' | |
| workflow_dispatch: | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| 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 # no lockfile to rely on | |
| - name: Install dependencies | |
| run: npm install # npm ci won't work without a synced lockfile | |
| 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 | |
| exclude_assets: '' | |
| user_name: 'github-actions[bot]' | |
| user_email: 'github-actions[bot]@users.noreply.github.com' | |
| commit_message: 'docs: deploy documentation [skip ci]' | |