Claude Code for Blog on Autopilot: Automated SEO for Your SaaS
Every SaaS needs content to rank. But writing daily SEO blog posts? That's a full-time job. Here's how to put your blog on autopilot using Claude Code and GitHub Actions—generating keyword-targeted articles automatically, every day.
What You're Building
A GitHub Actions workflow that:
- Runs daily on schedule
- Uses Claude Code to research and write SEO content
- Auto-commits new articles to your repo
- Costs ~$1-2 per article
No manual work required.
The Complete Setup
Step 1: Create the Workflow
Add .github/workflows/blog-generator.yml to your repo:
name: Daily SEO Blog Generator
on:
schedule:
- cron: '0 6 * * *' # Daily at 6 AM UTC
workflow_dispatch: # Manual trigger
jobs:
generate-blog:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install Claude Code
run: npm install -g @anthropic-ai/claude-code
- name: Generate Blog Post
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
run: |
claude --dangerously-skip-permissions -p "Your SEO prompt here"
- name: Commit and Push
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add path/to/blog/content
git diff --staged --quiet || git commit -m "Blog: Add article $(date +%Y-%m-%d)"
git pushStep 2: Add Your API Key
Repository Settings → Secrets → Actions → New secret
- Name:
ANTHROPIC_API_KEY - Value: Your Anthropic API key
Step 3: Write Your Prompt
The prompt is everything. Here's a template:
You are an SEO content strategist for [YOUR SAAS], a [description].
TASK: Add one SEO-optimized blog article.
RESEARCH FIRST:
1. Read existing blog content to avoid duplicates
2. Search for trending keywords in [your niche]
3. Find competitor content gaps
TARGET KEYWORDS (pick one category):
- "[product] vs [competitor]" - comparison posts
- "how to [problem you solve]" - tutorials
- "best [category] for [use case]" - listicles
ARTICLE REQUIREMENTS:
- 1200-1500 words
- Primary keyword in title + first paragraph
- 4-5 H2 sections
- 3 FAQs for schema markup
- Natural CTA for product
OUTPUT: Save as [your format] to [file path]Step 4: Test It
Actions → Daily SEO Blog Generator → Run workflow
Watch it research, write, and commit. Takes 2-3 minutes.
Why This Works
Most AI content fails because it's stateless—no context about your existing content or market.
Claude Code is different:
- Reads your codebase to avoid duplicate topics
- Searches the web for current keyword opportunities
- Follows structured prompts for consistent SEO formatting
It's a content strategist, not just a text generator.
Cost Breakdown
| Frequency | Monthly Cost | Articles/Year |
|---|---|---|
| Daily | $30-60 | 365 |
| 3x/week | $15-25 | 156 |
| Weekly | $5-10 | 52 |
Compare that to $100+ per article from freelancers.
Quick Customizations
- Developer tools SaaS: Target "how to integrate X with Y" tutorials
- B2B SaaS: Focus on "[your product] vs [competitor]" comparisons
- Vertical SaaS: Create "[industry] compliance" content
- International: Add translation steps for multi-language SEO
Important Notes
Review first
Output to drafts. Human editing adds the final polish.
The --dangerously-skip-permissions flag
Required for autonomous file operations. Safe in GitHub Actions (runners are ephemeral).
Prompt iteration
Your first prompt won't be perfect. Refine weekly based on output quality.
Setup Checklist
- ☐ Create workflow YAML file
- ☐ Add
ANTHROPIC_API_KEYsecret - ☐ Customize prompt for your niche
- ☐ Set correct output file path
- ☐ Test with manual trigger
- ☐ Review first week's output
- ☐ Iterate on prompt
The Result
One workflow file. One API key. Daily SEO content.
While you build product, your blog builds domain authority. That's the leverage every SaaS founder needs.
Found this helpful? Share it with your network