Deploying and Automating with Git + Cloudflare (Day 5)
Deployment should take 30 minutes, not 30 hours. The goal is a workflow where every change you make goes live automatically in under 60 seconds. Here is how.
GitHub Setup
GitHub is free for private repositories. You do not need a paid plan for anything in this playbook.
If you are new to Git:
Git is version control. It tracks every change you make to your code. GitHub is a cloud service that stores your Git repositories. Think of it like Google Docs version history but for code.
The essential commands you need:
# Initial setup (one time)
git init
git remote add origin [your-github-url]
# Daily workflow
git add .
git commit -m "description"
git push origin main
That is it. Three commands. You do not need branches, pull requests, merge strategies, or any of the complexity that teams use. You are a solo founder. Keep it simple.
Creating your repo:
- Go to github.com and create a free account (if you do not have one)
- Click "New Repository"
- Name it (your product name or domain name)
- Select "Private"
- Click "Create Repository"
- Follow the instructions to push your existing code
If you are using Claude Code, it can handle Git operations directly. Just tell it:
Initialize a git repository for this project,
create a .gitignore file appropriate for [your framework],
and push the initial commit to [your GitHub repo URL].
GitHub Student Developer Pack. If you are a student, GitHub bundles free offers from many developer tools in the Student Developer Pack, including cloud credits and domain offers. Verified students also get free GitHub Copilot access through the Copilot Student plan. Apply at education.github.com.
Deploying to Cloudflare Pages
Cloudflare Pages is a hosting platform with a free plan that automatically deploys your website every time you push to GitHub. It suits static sites and frameworks like Astro, Next.js (static export), and plain HTML. The free plan allows 500 builds a month, one build at a time, and up to 100 custom domains per project. Cloudflare also offers static asset hosting on Workers, which uses a similar Git workflow; either works for this playbook.
Step-by-step setup:
- Log into your Cloudflare dashboard
- Go to "Workers & Pages" in the sidebar
- Click "Create" and choose the Pages option (dashboard labels change, so follow Cloudflare's current prompts)
- Select "Connect to Git"
- Authorize Cloudflare to access your GitHub account
- Select your repository
- Configure build settings:
| Framework | Build Command | Output Directory |
|---|---|---|
| Astro | npm run build |
dist |
| Next.js (static) | npm run build |
out |
| HTML/CSS/JS | (none) | / or public |
- Click "Save and Deploy"
Cloudflare will pull your code from GitHub, run the build command, and deploy your site. A first deployment usually takes a few minutes. Every subsequent push to GitHub triggers an automatic re-deployment.
Connecting your custom domain:
- In Cloudflare Pages, go to your project settings
- Click "Custom Domains"
- Add your domain (yourdomain.com)
- Cloudflare automatically configures DNS since you already use Cloudflare DNS
Your website is now live at yourdomain.com with:
- HTTPS (automatic)
- Global CDN (your site loads fast everywhere)
- DDoS protection (free)
- Automatic deployments on every git push
The daily workflow:
Make changes locally (or with Claude Code)
|
v
git add . && git commit -m "update" && git push
|
v
Cloudflare auto-detects the push
|
v
Builds and deploys, usually in a minute or two
|
v
Changes live at yourdomain.com
Zero server management. Zero deployment scripts. Zero DevOps overhead.
Cloudflare Workers (When You Need More)
Cloudflare Pages handles static websites and basic server-side rendering. When you need API endpoints, serverless functions, or dynamic backend logic, Cloudflare Workers steps in.
Free tier includes:
- 100,000 requests per day
- 10 ms CPU time per invocation
- Workers KV (key-value storage): 100,000 reads and 1,000 writes per day, 1 GB stored
- D1 (SQLite database): 5 million rows read and 100,000 rows written per day, 5 GB total
The Workers Paid plan starts at $5 a month per account when you outgrow these limits.
When you need Workers:
- Your MVP has an API that the frontend calls
- You need server-side logic (authentication callbacks, webhook handlers)
- You want to run scheduled tasks (cron triggers)
When you might need something beyond Workers:
- Your product needs a full Postgres database with complex queries
- You need large file uploads (Cloudflare R2 handles storage, but the upload flow takes more setup)
- You need long-running background processes that exceed Workers' CPU limits
For these cases, consider:
- Supabase (free tier: 500 MB Postgres database, 50,000 monthly active users for auth, 1 GB file storage; free projects pause after a week of inactivity)
- AWS Lambda + DynamoDB (new accounts get starter credits under the AWS Free Tier; check each service's free limits)
- Railway (Hobby plan $5/month including $5 of usage: easy deployment for full-stack apps)
Keep your infrastructure as simple as possible for as long as possible. Complexity is the enemy of a solo founder. Every additional service is another thing that can break at 2 AM when you are the only person on call.
Setting Up Analytics (Free)
You need to know who visits your site, where they come from, and what they do. But you do not need expensive analytics. Free options:
Cloudflare Web Analytics (recommended):
- Already included with your Cloudflare account
- Privacy-friendly (no cookies)
- Shows page views, visitors, top pages, referrers
- Enable it in Cloudflare Dashboard under Web Analytics
Google Search Console (required):
- Shows how your site performs in Google search
- Which keywords you rank for
- Which pages get impressions and clicks
- Alerts you to indexing issues
Set it up:
- Go to search.google.com/search-console
- Add your property (domain verification)
- Verify via DNS TXT record (add to Cloudflare)
- Submit your sitemap URL
Google Analytics (optional):
- More detailed visitor behavior tracking
- Free but requires cookie consent banner (GDPR)
- Useful if you want conversion tracking
- Can be added later when you have more traffic
Do not obsess over analytics yet. In the first two weeks, you will not have enough traffic for the data to be meaningful. Set up Cloudflare Web Analytics and Google Search Console now. Come back to analytics when you have 50+ daily visitors. Until then, focus on building and shipping.
Automating Your Workflow
As a solo founder, automation is your unfair advantage. Every repetitive task you automate is time you can spend on building or selling.
Automations to set up now:
1. Deployment (already done). Every git push auto-deploys. Done.
2. Uptime monitoring. Use a free service like UptimeRobot (50 monitors at 5-minute intervals on the free plan) or Better Stack to ping your site. You get an email or Slack alert if your site goes down.
3. Email notifications. Set up Gmail filters to auto-label emails from:
- support@, label: Support
- hello@, label: General
- social@, label: Social
- Any email containing "unsubscribe", label: Marketing (skip inbox)
4. Social media scheduling. Use Buffer (free plan: 3 channels, 10 scheduled posts per channel at a time) to schedule social posts in advance. Write a week's worth of posts on Sunday, schedule them, and forget about it.
5. Content backups. Your code is in GitHub (backed up). Your email is in Google (backed up). Your DNS is in Cloudflare (backed up). The only thing you need to manually back up is content that lives outside these systems (design files, spreadsheets, notes). Use Google Drive.
Environment Variables and Secrets
When your product needs API keys, database credentials, or other secrets, never put them in your code. Use environment variables.
In Cloudflare Pages:
- Go to your project settings
- Click "Environment Variables"
- Add variables for each environment (Production, Preview)
Common environment variables you will need:
| Variable | Purpose | When |
|---|---|---|
STRIPE_SECRET_KEY |
Payment processing | Week 2 (MVP) |
SUPABASE_URL |
Database connection | Week 2 (MVP) |
SUPABASE_KEY |
Database authentication | Week 2 (MVP) |
RESEND_API_KEY |
Transactional email | Week 2 (MVP) |
AI_API_KEY |
AI features in product | Week 2 (MVP) |
Never commit secrets to Git. Not even in a private repo. Add a .env file to your .gitignore immediately. Use .env.example (with placeholder values) to document which variables are needed. This is a security habit you should build from day one.
End of Day 5 Checkpoint
By the end of Day 5, you have:
- GitHub repository set up (free)
- Cloudflare Pages deployment working (free)
- Custom domain connected with HTTPS (free)
- Auto-deployment on every git push
- Cloudflare Web Analytics active
- Google Search Console configured
- Uptime monitoring active
- Basic automations in place
Total additional spend: $0
Your website is live, fast, secure, and automatically deployed. A few years ago this setup would have needed a DevOps engineer. Total infrastructure cost: zero.
Tomorrow, you start building your distribution engine, before writing a single line of product code.