CI: consolidate docs deployment workflows and add PR previews #6
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: Publish Docs | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| branches: [master] | |
| types: [opened, synchronize, reopened, closed] | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| statuses: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: true | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout 🛎️ | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install and Build 🔧 | |
| run: | | |
| npm ci | |
| npm run build | |
| - name: Deploy Preview � | |
| if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository | |
| uses: rossjrw/pr-preview-action@v1 | |
| with: | |
| source-dir: ./build/ | |
| preview-branch: gh-pages-pr-previews | |
| umbrella-dir: pr-preview | |
| action: auto | |
| - name: Deploy to GitHub Pages � | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/master' | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| branch: gh-pages | |
| folder: build |