· 5 min read
Generate AI Videos in Your CI/CD Pipeline with GitHub Actions
Why automate video generation in CI/CD?
Teams already automate tests, deployments, and notifications. Video is the missing piece. Here are three use cases where automated video generation pays for itself immediately:
The GitHub Action
The agent-media GitHub Action is a reusable workflow that calls the agent-media API to generate a UGC video. It accepts a script, an optional actor, duration, and subtitle style. When sync: true is set, it polls until the video is ready and outputs the URL.
The action outputs video_url and job_id so downstream steps can use the generated video — post it to Slack, attach it to a GitHub release, or upload it to your CDN.
Setup: 2 minutes
- .
Basic usage: video on every release
This workflow triggers on every GitHub release and generates a 10-second UGC video with the release name embedded in the script. The video URL is available in the workflow summary.
That is the entire workflow. Push this file to your repo and every release automatically gets a video. The action handles API authentication, job submission, polling, and output extraction.
Changelog-driven videos
Want a video every time you update your changelog? This workflow watches for changes to CHANGELOG.md on the main branch, extracts the latest entry, and generates a video from it.
Advanced: matrix strategy for multiple variants
Need multiple versions of the same video for A/B testing? Use a GitHub Actions matrix strategy to generate variants in parallel — different actors, different subtitle styles, all from the same script.
This generates 6 video variants (3 actors x 2 styles) in parallel. Each variant runs as its own job, so they all execute concurrently. With a 10-second video taking roughly 60 seconds to render, you get all 6 variants in about a minute.
Under the hood: the API call
The GitHub Action wraps a single REST API call. If you want to integrate video generation into other CI/CD systems (GitLab CI, CircleCI, Jenkins), here is the raw API call:
The API returns a job ID immediately. Poll GET /v1/jobs/:job_id until the status is completed to get the video URL. The GitHub Action handles this polling loop automatically.
What teams are building with this
Add video generation to your pipeline
One secret, one workflow file, automated videos on every deploy.
uses: agent-media/videoagent/.github/workflows/generate-video.yml@main
with:
script: "Your script here"
secrets:
AGENT_MEDIA_API_KEY: \${{ secrets.AGENT_MEDIA_API_KEY }}