docs: surface bonus chapter in tutorial sidebar (#2381) #10
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 static sites | |
| on: | |
| push: | |
| branches: [develop] | |
| paths: | |
| - 'web/**' | |
| - '.github/workflows/web-deploy.yml' | |
| pull_request: | |
| branches: [develop] | |
| paths: | |
| - 'web/**' | |
| - '.github/workflows/web-deploy.yml' | |
| repository_dispatch: | |
| types: [registry-updated] | |
| jobs: | |
| deploy: | |
| name: Deploy ${{ matrix.site }} | |
| runs-on: ubuntu-latest | |
| concurrency: | |
| group: web-deploy-${{ matrix.site }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| deployments: write | |
| pull-requests: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| site: ${{ github.event_name == 'repository_dispatch' && fromJSON('["packages"]') || fromJSON('["landing", "blog", "guides", "api", "packages"]') }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Set up pnpm | |
| uses: pnpm/action-setup@v5 | |
| with: | |
| version: 10.23.0 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| cache-dependency-path: web/pnpm-lock.yaml | |
| - name: Install dependencies | |
| working-directory: web | |
| run: pnpm install --frozen-lockfile | |
| - name: Build ${{ matrix.site }} | |
| working-directory: web | |
| run: pnpm --filter @wheels-dev/site-${{ matrix.site }} build | |
| - name: Deploy to Cloudflare Pages | |
| working-directory: web | |
| env: | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| # Routed via env to keep untrusted branch names out of the command string. | |
| DEPLOY_BRANCH: ${{ github.head_ref || github.ref_name }} | |
| SITE: ${{ matrix.site }} | |
| run: | | |
| pnpm dlx wrangler@4.78.0 pages deploy "sites/${SITE}/dist" \ | |
| --project-name="wheels-${SITE}" \ | |
| --branch="${DEPLOY_BRANCH}" \ | |
| --commit-hash="${GITHUB_SHA}" | |
| visual-regression: | |
| name: Visual regression | |
| # Hard gate as of 2026-04. Baselines soaked through the initial | |
| # Phase 3 rollout (#2158, #2159, #2160, #2161, #2162). If this job | |
| # fails on your PR and the change is intentional, download the | |
| # `visual-regression-diffs` artifact and copy each `*.actual.png` | |
| # over the matching `web/tests/visual-baselines/*.png`, commit, | |
| # and push. | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Set up pnpm | |
| uses: pnpm/action-setup@v5 | |
| with: | |
| version: 10.23.0 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| cache-dependency-path: web/pnpm-lock.yaml | |
| - name: Install dependencies | |
| working-directory: web | |
| run: pnpm install --frozen-lockfile | |
| - name: Cache Playwright browsers | |
| uses: actions/cache@v5 | |
| id: playwright-cache | |
| with: | |
| path: ~/.cache/ms-playwright | |
| key: playwright-${{ runner.os }}-${{ hashFiles('web/pnpm-lock.yaml') }} | |
| - name: Install Playwright Chromium | |
| if: steps.playwright-cache.outputs.cache-hit != 'true' | |
| working-directory: web | |
| run: pnpm exec playwright install --with-deps chromium | |
| - name: Build all sites | |
| working-directory: web | |
| run: pnpm build | |
| - name: Run visual regression | |
| working-directory: web | |
| run: pnpm visual:test | |
| - name: Upload diffs on failure | |
| if: failure() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: visual-regression-diffs | |
| path: | | |
| web/tests/visual-diffs/*.png | |
| web/tests/visual-baselines/*.png | |
| if-no-files-found: ignore | |
| retention-days: 14 | |
| # Note: the packages-index baseline auto-refresh that fires on | |
| # repository_dispatch: registry-updated lives in its own workflow file | |
| # at .github/workflows/refresh-packages-baseline.yml so it doesn't | |
| # appear as a "skipped" check on regular PRs. |