1 Deployment
Ella Mizuki edited this page 2026-07-03 04:33:23 +00:00

Deployment

Overview

Environment URL Branch Auto-Deploy
Production https://breaking.yuricunha.com main ✅ Yes
Preview https://*.vercel.app PRs ✅ Yes
Local http://localhost:4321 — Manual

Platform: Vercel (Static) Build Command: pnpm build Output Directory: dist/ Node Version: 24.x

Vercel Configuration

Vercel detects Astro automatically and deploys the static dist output without an adapter or serverless functions.

  • Framework preset: Astro
  • Install command: pnpm install
  • Build command: pnpm build
  • Output directory: dist
  • Node.js: 24.x

The actual vercel.json contains security headers only — Vercel auto-detects Astro and infers build settings from the framework preset.

Security Headers (vercel.json)

{
  "$schema": "https://openapi.vercel.sh/vercel.json",
  "headers": [
    {
      "source": "/(.*)",
      "headers": [
        { "key": "Permissions-Policy", "value": "camera=(), microphone=(), geolocation=(), payment=(), usb=(), xr-spatial-tracking=(), fullscreen=(self)" },
        { "key": "Content-Security-Policy", "value": "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self' data:; connect-src 'self'; frame-ancestors 'none';" },
        { "key": "Strict-Transport-Security", "value": "max-age=63072000; includeSubDomains; preload" },
        { "key": "Cross-Origin-Opener-Policy", "value": "same-origin" },
        { "key": "X-Frame-Options", "value": "DENY" },
        { "key": "X-Content-Type-Options", "value": "nosniff" }
      ]
    }
  ]
}

Build Process

Local Build Verification

# Clean install
pnpm install --frozen-lockfile

# Type-check + build
pnpm build

# Verify output
ls dist/
# Should contain: index.html, blog/, snippets/, projects/, _astro/, etc.

Build Steps (Automated on Vercel)

  1. Install — pnpm install --frozen-lockfile
  2. Type-check — astro check (TypeScript + Astro diagnostics)
  3. Content sync — Astro content collections loaded
  4. Static generation — All pages pre-rendered
  5. Asset optimization — Fonts, CSS, JS minified
  6. Sitemap generation — sitemap-index.xml + locale variants
  7. Output — dist/ folder uploaded to Vercel CDN

Deployment Workflow

Production Deploy

# 1. Ensure main is up to date
git checkout main
git pull origin main

# 2. Verify locally
pnpm build

# 3. Push (triggers Vercel deploy)
git push origin main

Preview Deploy (PR)

  1. Open PR against main
  2. Vercel creates preview deployment
  3. URL posted as PR comment
  4. Review, then merge

Rollback

Vercel Dashboard → Deployments → Click "..." → Promote to Production

Or:

vercel rollback [deployment-url]

Domain Configuration

Primary Domain: breaking.yuricunha.com

Vercel Dashboard → Settings → Domains

Domain Type Redirect
breaking.yuricunha.com Primary —

DNS (Managed at Registrar)

Record Value
A 76.76.21.21 (Vercel)
CNAME www cname.vercel-dns.com

SSL

  • Automatic via Vercel (Let's Encrypt)
  • HSTS enabled via vercel.json headers

Performance

Static Output Benefits

  • Zero server execution — HTML served from CDN edge
  • Instant TTFB — No SSR, no cold starts
  • Global cache — Vercel Edge Network (35+ regions)
  • Brotli/Gzip — Automatic compression

Core Web Vitals Targets

Metric Target Achieved
LCP < 2.5s ✅ ~0.8s
FID < 100ms ✅ ~10ms
CLS < 0.1 ✅ ~0
TTFB < 200ms ✅ ~50ms

Checklist: Pre-Deploy

  • pnpm build passes locally
  • pnpm check passes (0 errors)
  • pnpm content:check passes
  • All locales have content (or accepted fallback)
  • No console.error in build output
  • Preview deployment tested
  • Domain DNS correct
  • SSL active