# cloudflare-deploy > Load deploy commands and environment details. Usage: /cloudflare-deploy - Author: Paul - Repository: paulberesuita/soccerbars - Version: 20260127223628 - Stars: 0 - Forks: 0 - Last Updated: 2026-02-06 - Source: https://github.com/paulberesuita/soccerbars - Web: https://mule.run/skillshub/@@paulberesuita/soccerbars~cloudflare-deploy:20260127223628 --- --- name: cloudflare-deploy description: Load deploy commands and environment details. Usage: /cloudflare-deploy user_invokable: true --- # Cloudflare Deploy Deploy commands for SoccerBars. --- ## Project Details | Resource | Name | |----------|------| | Pages Project | `soccerbars` | | D1 Database | `soccerbars-db` | | R2 Bucket | `soccerbars-images` | | Domain | `soccerbars.fyi` | | Preview URL | `soccerbars.pages.dev` | **CRITICAL:** Both preview and production are the SAME project. One deploy updates both URLs. --- ## Commands ```bash # Local dev wrangler pages dev ./public --d1=DB=soccerbars-db --local # Run a migration (remote) npx wrangler d1 execute soccerbars-db --file=./migrations/XXX.sql --remote # Run ad-hoc SQL (remote) npx wrangler d1 execute soccerbars-db --remote --command "SELECT COUNT(*) FROM bars;" # Deploy (updates BOTH preview and production) wrangler pages deploy ./public --project-name=soccerbars # Upload image to R2 npx wrangler r2 object put soccerbars-images/bars/city/slug.jpg --file=./temp/slug.jpg --remote # List R2 objects npx wrangler r2 object list soccerbars-images --remote ``` --- ## wrangler.toml ```toml name = "soccerbars" compatibility_date = "2024-01-01" pages_build_output_dir = "./public" [[d1_databases]] binding = "DB" database_name = "soccerbars-db" database_id = "acd402b2-731a-4390-9bb4-af71e85f3043" [[r2_buckets]] binding = "IMAGES" bucket_name = "soccerbars-images" ``` --- ## Migration Naming Migrations are numbered sequentially: ``` migrations/ ├── 001_initial.sql ├── 002_add_[feature].sql ├── 003_add_[feature].sql └── ... ``` Always use the next number. Check existing migrations before creating. --- ## Post-Deploy Checklist - [ ] Visit production URL — homepage loads - [ ] Check a city page: `/new-york` - [ ] Check a bar detail page: `/new-york/smiths-pub` - [ ] Check images load (no broken thumbnails) - [ ] No console errors in browser DevTools --- ## Common Issues | Problem | Fix | |---------|-----| | Deploy goes to wrong project | Always use `--project-name=soccerbars` | | D1 command fails with auth error | Run `npx wrangler login` to refresh token | | R2 upload 404s | Add `--remote` flag (defaults to local) | | Page not updating | Edit `functions/[city]/[[slug]].js`, not `index.js` |