AI agents & automation

An LLM Content Pipeline With GitHub Actions

A step-by-step design for an LLM content pipeline that runs on GitHub Actions: topic queue, generation, validation, review and publishing, based on a production setup.

By Devang GandhiUpdated Nov 3, 20267 min read

An AI content automation pipeline sounds like a single script that turns keywords into blog posts. The versions that actually work in production look more like a small assembly line: a queue of topics, a generation step, validation, review and publishing, each one boring and testable on its own.

I have built this kind of pipeline on GitHub Actions with a self-hosted runner and a Groq-hosted LLaMA model. This post walks through the design, the quality gates that matter, and the mistakes that turn automated content into a liability.

TL;DR

Break the pipeline into stages: topic queue, brief, draft, validate, open a pull request, human approve, publish. Run it on a GitHub Actions schedule so you get logs, secrets and review for free. Use a fast, cheap model for drafts and invest your effort in the brief and the validator. Never auto-publish without a human approval step.

key takeaways

  • An AI content automation pipeline is a sequence of small, testable stages, not one giant prompt.
  • GitHub Actions gives you scheduling, logs, secrets and pull-request review without running extra infrastructure.
  • Automated quality gates such as schema checks, word counts and link validation catch most bad drafts before a human sees them.
  • Fast, cheap models are usually enough for drafting when the brief and validation are strong.

The stages of a content pipeline

Each stage should have one input, one output and one way to fail loudly. That makes it easy to rerun a single step when something breaks.

Stage Input Output Fails when
Topic queue Keyword plan (JSON or sheet) Next unclaimed topic Queue empty
Brief builder Topic + site facts Structured brief Missing required fields
Draft Brief Markdown with frontmatter Model error or timeout
Validate Markdown Pass/fail report Any rule broken
Pull request Valid file PR with diff Git conflict
Publish Merged PR Live page Build fails

The topic queue

Keep topics in a versioned file such as content/plan.json with fields like slug, title, primaryKeyword, status and relatedPosts. The job picks the first row with status: "todo", which makes progress visible in git history and prevents duplicate posts.

The brief

The brief does most of the quality work. It includes the target keyword, the audience, the required sections, internal links to include, and a strict list of facts the model may cite. A good brief turns a mediocre model into a reliable drafter.

The draft

Ask for the complete file in one call, frontmatter included, and set a low-to-moderate temperature. If the topic is long, generate an outline first and then each section, but in my experience a single pass against a detailed brief is fine for 1,200 to 1,600 words.

Running it on GitHub Actions

GitHub Actions is a good fit because the pipeline is periodic, short-lived and produces files that belong in your repository. A scheduled workflow with on: schedule and a cron expression kicks off the job, and workflow_dispatch lets you run it by hand. The GitHub Actions workflow syntax docs cover both triggers.

Hosted or self-hosted runner

Hosted runners are fine to start. A self-hosted runner on a small VM makes sense when you want to reuse cached dependencies, call internal services, or avoid per-minute costs on frequent jobs. I run self-hosted runners for several projects, managed with systemd so they restart on reboot.

Secrets and model calls

Store the model API key as a repository secret and read it as an environment variable. Wrap the model call with a timeout and one or two retries with backoff. Log token counts so you know what each post costs.

Open a pull request, not a direct commit

The job should commit the new file to a branch and open a pull request. The PR diff is your review interface, and the preview deployment from your hosting provider lets an editor see the rendered page before merge.

Quality gates that catch bad drafts

Validation is where most pipelines are weak. A model will occasionally drop a section, invent a statistic or link to a page that does not exist. Automated checks catch most of this cheaply.

  1. Parse the frontmatter and fail if any required field is missing.
  2. Check title and meta description length against your SEO limits.
  3. Confirm the primary keyword appears in the first 100 words.
  4. Verify every internal link points to a real route or known slug.
  5. Enforce a word-count range so you do not ship thin pages.
  6. Scan for banned phrases and filler your brand never uses.
  7. Flag any number or percentage for a human to verify against the fact list.

When a check fails, feed the error messages back to the model for one repair attempt, then stop. If it still fails, mark the topic needs_review and move on. Endless repair loops waste tokens and rarely fix a bad brief.

How I built this in practice

At Passdn Technologies, alongside my core engineering work on the Antoc AI real-estate CRM, we built an automated SEO blog pipeline using Groq-hosted LLaMA for generation and a GitHub Actions self-hosted runner to schedule and run it. You can read more about the wider product in the Antoc case study.

We chose Groq because drafting is a high-volume, cost-sensitive job, and fast inference kept each run short. The runner lived on the same kind of GCP infrastructure we already managed with PM2, Nginx and systemd, so there was no new platform to learn. The pipeline reused patterns from the rest of our AI work: Gemini for classification in our tender intelligence bot, Claude and MCP for agentic CRM actions, and a cheap model where a cheap model is enough.

The biggest lesson was that the validator and the brief mattered more than the model. Once the rules live in code, a reviewer can read for accuracy and voice instead of fixing formatting by hand.

Common mistakes

  • Auto-publishing straight to production with no human approval step.
  • Writing one enormous prompt instead of a structured brief with an explicit fact list.
  • Letting the model invent statistics, client names or quotes.
  • Skipping link validation, which leads to broken internal links across dozens of posts.
  • Generating near-duplicate posts because the topic plan has overlapping keywords.
  • Retrying failed drafts forever instead of flagging them for a person.

keep reading

FAQ

Can AI-generated blog posts rank on Google?+

They can if they are genuinely useful, accurate and reviewed. Google's guidance focuses on helpful content rather than how it was produced, so the pipeline must enforce facts, structure and human review instead of mass-producing thin pages.

Why use GitHub Actions instead of a separate server?+

Actions already gives you cron schedules, secret storage, logs and pull requests. For a content pipeline that runs a few times a day, that is usually all the infrastructure you need, and the output lands as a reviewable commit.

Which LLM should I use for content generation?+

For first drafts against a detailed brief, a fast open model such as LLaMA served by Groq is often good enough and cheap. Use a stronger model for editing passes or technical topics where accuracy matters more.

How much human review does an automated pipeline need?+

At minimum, a person should approve every post before it goes live. Automation should handle formatting, validation and scheduling so the reviewer spends their time on accuracy and voice.

Devang Gandhi

AI & full stack developer at Passdn, building CRMs, SaaS, AI agents and Flutter apps for clients in the US, UK, Australia, UAE and India. More about me

Read next

More in AI agents & automation