Skip to main content

Purpose

Batch deploys all pending files to Vercel in a single deployment. Called after content generation jobs complete.

Architecture

Request Body

{
  "project_name": "business-abc123",
  "files": [
    {"path": "/topic-slug/index.html", "content": "..."},
    {"path": "public/sitemap.xml", "content": "..."}
  ],
  "ai_site_url": "https://business.searchcompany.dev",
  "source_url": "https://customer-domain.com",
  "business_name": "Acme Corp",
  "products": ["Product A", "Product B"],
  "new_posts": [...],
  "existing_posts": [...],
  "verify_paths": ["/topic-slug/"]
}

Key Features

Boosted Section Preservation

When deploying a new index.js, existing boosted page links are preserved:
// Existing boosted sections are extracted and merged
const existing = extract_boosted_sections(current_index)
const merged = merge_boosted_sections_into_new_index(new_index, existing)

FAQ Sync

Automatically adds missing boosted page links to FAQ sections.

Sitemap Regeneration

Regenerates sitemap.xml to include all boosted pages.

Response Format

{
  "status": "success",
  "deployment_url": "https://...",
  "ai_site_url": "https://business.searchcompany.dev",
  "files_deployed": 15,
  "verified_paths": ["/topic-slug/"]
}

Code Location

src/app/apis/cron/deploy_to_vercel/
├── routes.py    # HTTP endpoint
└── helpers/
    ├── index_js.py       # Index.js manipulation
    ├── sitemap.py        # Sitemap generation
    └── boosted_sections.py # Boosted section extraction