Skip to content

fix(website): bucket A — landing & docs polish #142

fix(website): bucket A — landing & docs polish

fix(website): bucket A — landing & docs polish #142

Workflow file for this run

name: CI
on:
pull_request:
branches: [main]
push:
branches: [main]
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v5
- uses: actions/setup-node@v6
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm test
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v5
- uses: actions/setup-node@v6
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm typecheck
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v5
- uses: actions/setup-node@v6
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm lint
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v5
- uses: actions/setup-node@v6
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm format
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v5
- uses: actions/setup-node@v6
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm build
packaging:
name: Packaging — publint + attw
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v5
- uses: actions/setup-node@v6
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm -r --filter '@pretable/core' --filter '@pretable/react' --filter '@cacheplane/json-stream' build
- run: pnpm -r --filter '@pretable/core' --filter '@pretable/react' --filter '@cacheplane/json-stream' lint:packaging
deploy-prod:
name: Deploy → Vercel (production)
needs: [test, typecheck, lint, format, build, packaging]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
# Required GitHub secrets:
# VERCEL_TOKEN — vercel.com/account/tokens
# VERCEL_ORG_ID — Vercel team id
# VERCEL_PROJECT_ID — pretable project id
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v5
- uses: actions/setup-node@v6
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Install Playwright browser
run: pnpm exec playwright install --with-deps chromium webkit
- name: Pull Vercel project settings
run: |
mkdir -p .vercel
cat > .vercel/project.json <<EOF
{"projectId":"${{ secrets.VERCEL_PROJECT_ID }}","orgId":"${{ secrets.VERCEL_ORG_ID }}","projectName":"pretable"}
EOF
npx vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
rm -rf .vercel/output
- name: Build with Vercel
run: npx vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy to Vercel (production)
id: deploy
run: |
url=$(npx vercel deploy --prebuilt --archive=tgz --prod --yes --token=${{ secrets.VERCEL_TOKEN }} | tail -n 1)
echo "deployment_url=$url" >> "$GITHUB_OUTPUT"
echo "Deployed: $url"
- name: Wait for production alias to update
# vercel deploy --prod returns once the unique deployment URL is
# ready; the public alias atomically repoints shortly after. A short
# readiness loop avoids racing the alias swap.
run: |
for i in 1 2 3 4 5 6; do
code=$(curl -sS -o /dev/null -w "%{http_code}" "https://pretable.vercel.app" || true)
echo "Attempt $i: HTTP $code"
if [ "$code" = "200" ]; then exit 0; fi
sleep 5
done
echo "Public alias did not return 200 after deploy"
exit 1
- name: Smoke test prod with Playwright
env:
BASE_URL: https://pretable.vercel.app
run: pnpm --filter @pretable/app-website smoke
- name: Upload smoke artifacts on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: website-smoke-traces
path: apps/website/test-results/
retention-days: 7
deploy-preview:
name: Deploy → Vercel (preview)
needs: [test, typecheck, lint, format, build, packaging]
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v5
- uses: actions/setup-node@v6
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Pull Vercel project settings
run: |
mkdir -p .vercel
cat > .vercel/project.json <<EOF
{"projectId":"${{ secrets.VERCEL_PROJECT_ID }}","orgId":"${{ secrets.VERCEL_ORG_ID }}","projectName":"pretable"}
EOF
npx vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
rm -rf .vercel/output
- name: Build with Vercel
run: npx vercel build --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy preview to Vercel
id: deploy
run: |
url=$(npx vercel deploy --prebuilt --archive=tgz --yes --token=${{ secrets.VERCEL_TOKEN }} | tail -n 1)
echo "preview_url=$url" >> "$GITHUB_OUTPUT"
echo "Preview: $url"
- name: Comment preview URL on PR
uses: marocchino/sticky-pull-request-comment@v2
with:
header: vercel-preview
message: |
### Vercel preview ready
**Preview**: ${{ steps.deploy.outputs.preview_url }}
**Commit**: `${{ github.event.pull_request.head.sha }}`
<sub>Updated automatically by the `deploy-preview` job.</sub>