# Cloudflare Pages Deploy Guide

This project is a static site. After you add approved links and a domain, deploy the repository as a static asset site.

## Build command

```powershell
node scripts/daily-run.mjs
node scripts/prepare-deploy-bundle.mjs
node scripts/check-static.mjs
```

## Output directory

Use `dist/site` as the static output directory. It contains only the public site files needed for publication.

## Automated attempt

The daily system runs:

```powershell
node scripts/prepare-deploy-bundle.mjs
node scripts/attempt-cloudflare-pages-deploy.mjs
```

`scripts/attempt-cloudflare-pages-deploy.mjs` is deliberately non-interactive. If `wrangler` is available and authorized, it deploys `dist/site`, captures the Pages URL, and writes it to `data/monetization-config.json`. If deployment cannot run, it writes the reason to `deployment-status.json` and the launch readiness audit.

## Production settings

- Set `SITE_URL` to the production domain before running `scripts/generate-article-pages.mjs`.
- Replace placeholder offer URLs in `src/app.js`.
- Prefer replacing links through `data/monetization-config.json` and `scripts/apply-monetization-config.mjs`.
- Connect the lead form to a real CRM endpoint before collecting production leads.
- Deploy `worker/index.js` if you want production event collection for clicks, leads, and product interest.
- Review `compliance.md` before publication.
