Vercel Cloudflare migration + admin dashboard + AI news automation
Source: Dev.to
Vercel → Cloudflare migration
Vercel’s cron requires the Pro plan. Needed twice‑daily AI news generation but couldn’t use cron on the free tier, so the site was moved to Cloudflare Pages and the cron jobs were separated into GitHub Actions.
Migration checklist
- Change adapter to
@astrojs/cloudflareinastro.config.mjs - Add
wrangler.toml - Register environment variables in the Cloudflare dashboard
- Disable preview builds (deploy main branch only)
- Set up three GitHub Actions cron jobs
# .github/workflows/cron-ai-news.yml
on:
schedule:
- cron: '0 0,12 * * *' # UTC 0,12 = KST 9 AM, 9 PMCloudflare Pages offers fast builds and a generous free tier, but SDKs that rely on Node.js built‑in modules (e.g., node:) won’t work.
AI news auto‑generation
Generates AI news automatically twice daily (KST 9 AM, 9 PM).
Source collection
Crawls five sources for AI‑related news:
- Google Custom Search – “AI” keyword search
- Hacker News –
/topstoriesAPI - Reddit – hot posts from
/r/artificial,/r/MachineLearning - X (Twitter) – AI trending topics
- GitHub Trending – today’s trending repositories
Post generation with Claude
Collected news is sent to Claude Haiku, which generates individual deep‑dive posts per topic. The workflow originally grouped posts by model (Claude, GPT, Gemini) but later switched to topic‑based individual posts.
The model was changed from Sonnet 4 to Haiku 4.5; generating 20+ posts daily raised cost concerns, though the quality difference was negligible.
Admin dashboard
Built an /admin page for at‑a‑glance site‑operations monitoring.
Tabs
- Overview: visitor heatmap, stat cards, build logs by project, top engagement
- Quick Actions: AI news generation, site rebuild, Dev.to sync
- Content: full content list with type filters
- Comments: comment management with delete
Visitor heatmap
A GitHub‑contributions‑style calendar heatmap that fetches the last 90 days from Upstash Redis. Includes month labels, day labels, and hover tooltips.
Dev.to cross‑posting
A GitHub Actions workflow automatically publishes new content to Dev.to.
How it works
- Detect changes in
src/content/subdirectories. - Query the Dev.to API for existing articles (deduplication via
canonical_url). - Publish only new posts via
POST /api/articles. - Posts tagged with
devto-migrationare excluded (they originated from Dev.to). - Rate limiting is handled with 3‑second intervals.
Gotcha: SDKs on Cloudflare Workers
Importing @anthropic-ai/sdk on Cloudflare Workers triggers node:events module errors because Workers run on V8 isolates, not Node.js.
Solution: Use fetch directly instead of the SDK.
Summary
- Cloudflare Pages + GitHub Actions cron enables scheduling without a Vercel Pro plan.
- AI news automation: 5‑source crawl → Claude Haiku post generation → twice‑daily publishing.
- Admin dashboard: SSR API + client‑side rendering for quick setup.
- Use
fetchover SDKs on Cloudflare Workers; libraries with Node.js dependencies won’t work.
📌 Originally published at Jidong Lab
More AI news and dev logs → jidonglab.com