Add mdbook documentation with GitHub Pages and PR previews #3
Workflow file for this run
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: PR Documentation Preview | |
| on: | |
| pull_request: | |
| types: [opened, reopened, synchronize, closed] | |
| concurrency: preview-${{ github.ref }} | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| preview: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup mdbook | |
| if: github.event.action != 'closed' | |
| uses: peaceiris/actions-mdbook@v2 | |
| with: | |
| mdbook-version: 'latest' | |
| - name: Build documentation | |
| if: github.event.action != 'closed' | |
| run: mdbook build | |
| - name: Ensure .nojekyll exists | |
| if: github.event.action != 'closed' | |
| run: touch book/.nojekyll | |
| - name: Deploy PR preview | |
| uses: rossjrw/pr-preview-action@v1 | |
| with: | |
| source-dir: book | |
| umbrella-dir: pr-preview | |
| action: auto |