Add Vale testing workflow for pull requests #1753
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
| # .github/workflows/preview.yml | |
| name: Deploy PR previews | |
| on: | |
| pull_request: | |
| types: | |
| - opened | |
| - reopened | |
| - synchronize | |
| - closed | |
| permissions: write-all | |
| # Re-edit this to see what's needed | |
| #permissions: | |
| # pull-requests: write | |
| # contents: write | |
| # pages: write | |
| concurrency: preview-${{ github.ref }} | |
| jobs: | |
| deploy-preview: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v6 | |
| with: | |
| # Pinned below 11.12.0, whose self-install crashes with | |
| # "Cannot use 'in' operator to search for 'integrity' in undefined". | |
| # https://github.com/pnpm/action-setup/issues/276 | |
| # https://github.com/pnpm/pnpm/issues/12959 | |
| version: 11.11.0 | |
| - run: echo "PREVIEW_PATH=pr-preview/pr-${{ github.event.number }}" >> "$GITHUB_ENV" | |
| - name: Install and Build | |
| if: github.event.action != 'closed' # Skip the build if the PR has been closed | |
| run: | | |
| pnpm install --prod --frozen-lockfile --ignore-scripts | |
| pnpm run build | |
| - name: Deploy preview | |
| uses: rossjrw/pr-preview-action@v1 | |
| with: | |
| preview-branch: gh-pages | |
| source-dir: build | |
| umbrella-dir: pr-preview | |
| action: auto |