chore: minor improvements #11
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: Percy Visual Regression Testing | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| percy: | |
| name: Visual Regression Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: π₯ Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: π¦ Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: π Install dependencies | |
| run: npm ci | |
| - name: π¨ Build site | |
| run: npm run build | |
| env: | |
| NODE_ENV: production | |
| - name: ποΈ Percy snapshot | |
| run: npx @percy/cli snapshot dist | |
| env: | |
| PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }} | |
| PERCY_PARALLEL_NONCE: ${{ github.run_id }}-${{ github.run_attempt }} | |
| PERCY_PARALLEL_TOTAL: 1 | |
| - name: π Upload build artifacts | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-output | |
| path: dist/ | |
| retention-days: 7 |