Skip to content

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:

  1. Go to github.com and create a free account (if you do not have one)
  2. Click "New Repository"
  3. Name it (your product name or domain name)
  4. Select "Private"
  5. Click "Create Repository"
  6. 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].
Tip

GitHub Student Developer Pack. If you are a student, GitHub gives you free access to dozens of premium tools through the Student Developer Pack. Free domains, free credits for cloud services, free Copilot, and more. Apply at education.github.com. This alone can save you hundreds of dollars.


Deploying to Cloudflare Pages

Cloudflare Pages is a free hosting platform that automatically deploys your website every time you push to GitHub. It is perfect for static sites and frameworks like Astro, Next.js, and plain HTML.

Step-by-step setup:

  1. Log into your Cloudflare dashboard
  2. Go to "Workers & Pages" in the sidebar
  3. Click "Create Application" then "Pages"
  4. Select "Connect to Git"
  5. Authorize Cloudflare to access your GitHub account
  6. Select your repository
  7. 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
  1. Click "Save and Deploy"

Cloudflare will pull your code from GitHub, run the build command, and deploy your site. First deployment takes 2-5 minutes. Every subsequent push to GitHub triggers an automatic re-deployment.

Connecting your custom domain:

  1. In Cloudflare Pages, go to your project settings
  2. Click "Custom Domains"
  3. Add your domain (yourdomain.com)
  4. 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 in 30-60 seconds
     |
     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
  • 10ms CPU time per request
  • Workers KV (key-value storage): 1,000 reads per day

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 need something beyond Cloudflare:

  • Your product requires a relational database with complex queries
  • You need file uploads larger than 25 MB
  • You need long-running background processes (over 30 seconds)

For these cases, consider:

  • Supabase (free tier: Postgres database, auth, storage, real-time)
  • AWS Lambda + DynamoDB (free tier: 1M requests/month, 25 GB storage)
  • Railway ($5/month: 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:

  1. Go to search.google.com/search-console
  2. Add your property (domain verification)
  3. Verify via DNS TXT record (add to Cloudflare)
  4. 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
Note

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 or Better Uptime to ping your site every 5 minutes. 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 tier: 3 channels, 10 scheduled posts each) 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:

  1. Go to your project settings
  2. Click "Environment Variables"
  3. 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)
Warning

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. You are now operating at a level of infrastructure sophistication that would have required a DevOps engineer five years ago. Total infrastructure cost: zero.

Tomorrow, you start building your distribution engine, before writing a single line of product code.