mirror of
https://github.com/vercel/workflow.git
synced 2026-09-14 19:59:43 +08:00
5c4eef0a97
* chore: upgrade to pnpm 12 * fix: support pnpm 12 in CI * fix: enable pnpm 12 on Vercel * refactor: simplify pnpm 12 setup * refactor: target pnpm 11.24.0 * refactor: let pnpm setup own CI installs * refactor: limit workspace Node versions * fix: complete pnpm 11 CI migration
103 lines
3.6 KiB
YAML
103 lines
3.6 KiB
YAML
name: Docs Checks
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
tags:
|
|
- "!*"
|
|
pull_request:
|
|
|
|
concurrency:
|
|
# Unique group for this workflow and branch
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
|
|
|
|
jobs:
|
|
docs-typecheck:
|
|
name: Docs Code Samples
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 5
|
|
env:
|
|
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
|
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
|
|
steps:
|
|
- name: Checkout Repo
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup pnpm
|
|
uses: pnpm/setup@703c52620218391530e48b9e8870d5c0082e1b9b # v2.1.0
|
|
with:
|
|
install: true
|
|
require-lockfile: true
|
|
runtime: node@22
|
|
cache: true
|
|
|
|
- name: Build packages
|
|
run: pnpm build
|
|
|
|
- name: Type-check documentation code samples
|
|
run: pnpm test:docs
|
|
|
|
docs-preview-smoke:
|
|
name: Docs Preview Smoke Checks
|
|
runs-on: ubuntu-latest
|
|
# `changeset-release/*` PRs are not deployed (every project's vercel.json
|
|
# sets `git.deploymentEnabled` false for that branch, because the branch is
|
|
# force-pushed to main's HEAD SHA and a same-SHA preview deployment
|
|
# clobbers the per-SHA Vercel commit status), so there is no preview to
|
|
# smoke-test. Their docs content is identical to main's, which this job
|
|
# already checked against production on the push that produced the bump.
|
|
if: ${{ !startsWith(github.head_ref, 'changeset-release/') }}
|
|
timeout-minutes: 5
|
|
permissions:
|
|
id-token: write
|
|
contents: read
|
|
deployments: read
|
|
statuses: read
|
|
env:
|
|
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
|
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
|
|
steps:
|
|
- name: Checkout Repo
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup pnpm
|
|
uses: pnpm/setup@703c52620218391530e48b9e8870d5c0082e1b9b # v2.1.0
|
|
with:
|
|
install: true
|
|
require-lockfile: true
|
|
runtime: node@22
|
|
cache: true
|
|
|
|
- name: Waiting for the Docs Vercel deployment
|
|
id: waitForDocsDeployment
|
|
uses: vercel/wait-for-deployment-action@0e2b0c5c5cce31f1648108aeec56467187aca037
|
|
with:
|
|
project-slug: workflow-docs
|
|
timeout: 1000
|
|
check-interval: 15
|
|
environment: ${{ github.ref == 'refs/heads/main' && 'production' || 'preview' }}
|
|
|
|
- name: Verify OpenGraph images and sitemap
|
|
if: steps.waitForDocsDeployment.outputs.deployment-state == 'success'
|
|
run: pnpm --filter docs test:smoke
|
|
env:
|
|
DEPLOYMENT_URL: ${{ steps.waitForDocsDeployment.outputs.deployment-url }}
|
|
# Trusted-sources OIDC token is minted on demand by
|
|
# scripts/trusted-sources-headers.mjs via the runner's
|
|
# ACTIONS_ID_TOKEN_REQUEST_URL/_TOKEN env vars (auto-set when
|
|
# `permissions: id-token: write` is on the job).
|
|
# See: https://vercel.com/docs/deployment-protection/methods-to-bypass-deployment-protection/trusted-sources
|
|
|
|
- name: Verify rendered docs links
|
|
if: steps.waitForDocsDeployment.outputs.deployment-state == 'success'
|
|
run: pnpm --filter docs lint:rendered-links
|
|
env:
|
|
DEPLOYMENT_URL: ${{ steps.waitForDocsDeployment.outputs.deployment-url }}
|
|
# Trusted-sources OIDC token is minted on demand by
|
|
# scripts/trusted-sources-headers.mjs via the runner's
|
|
# ACTIONS_ID_TOKEN_REQUEST_URL/_TOKEN env vars (auto-set when
|
|
# `permissions: id-token: write` is on the job).
|
|
# See: https://vercel.com/docs/deployment-protection/methods-to-bypass-deployment-protection/trusted-sources
|