Skip to main content
Integrating speak-mintlify into your CI/CD pipeline ensures your documentation audio stays in sync with content changes automatically.

GitHub Actions

Basic Workflow

Create a workflow file to generate audio on every push to your documentation:
1

Create workflow file

Add .github/workflows/tts.yaml to your repository:
.github/workflows/tts.yaml
2

Configure secrets

Add the following secrets in your GitHub repository settings (Settings → Secrets and variables → Actions):Secrets (sensitive values):
  • FISH_API_KEY - Your Fish Audio API key
  • S3_ACCESS_KEY_ID - S3 access key
  • S3_SECRET_ACCESS_KEY - S3 secret key
  • S3_BUCKET - Your S3 bucket name
Variables (non-sensitive):
  • S3_PUBLIC_URL - Public URL for your S3 bucket
  • S3_REGION - S3 region (e.g., us-east-1)
  • S3_ENDPOINT - S3 endpoint URL (optional, for R2/MinIO)
3

Test the workflow

Push a change to an MDX file or manually trigger the workflow from the Actions tab.

Advanced Workflow with Cleanup

Automatically remove orphaned audio files:
.github/workflows/tts-advanced.yaml
The [skip ci] tag in the commit message prevents the workflow from triggering itself in an infinite loop.

Preview Changes with Pull Requests

Run in dry-run mode on pull requests to preview changes:
.github/workflows/tts-preview.yaml

GitLab CI/CD

For GitLab repositories, create .gitlab-ci.yml:
.gitlab-ci.yml
Configure variables in GitLab under Settings → CI/CD → Variables. Mark sensitive values as “Masked” and “Protected”.

CircleCI

Create .circleci/config.yml:
.circleci/config.yml

Troubleshooting

Ensure all required secrets and variables are configured:
  • FISH_API_KEY
  • S3_ACCESS_KEY_ID
  • S3_SECRET_ACCESS_KEY
  • S3_BUCKET
  • S3_PUBLIC_URL
Check that variable names match exactly (case-sensitive).
For GitHub Actions, ensure the workflow has write permissions:
For GitLab, create a CI/CD variable CI_PUSH_TOKEN with an access token that has write_repository scope.
Add [skip ci] or [ci skip] to your commit message:
Or configure the workflow to skip commits from the bot:
Verify your S3 credentials have the correct permissions:
  • s3:PutObject - Upload files
  • s3:ListBucket - List objects for cleanup
  • s3:DeleteObject - Delete orphaned files
For AWS S3, check the bucket policy and IAM user permissions. For Cloudflare R2, verify the API token has R2 Edit permissions.
Check that MDX files aren’t in .gitignore. The workflow commits modified MDX files with audio components.If you want to keep MDX files clean, you can:
  1. Store generated components separately
  2. Use a different branch for generated content
  3. Configure --dry-run mode and handle uploads externally

Best Practices

Use workflow_dispatch

Allow manual workflow triggers for testing and one-off regeneration.

Cache dependencies

Use cache: 'npm' in setup-node to speed up workflows.

Run cleanup periodically

Schedule cleanup jobs weekly to remove orphaned files and reduce storage costs.

Monitor API usage

Track Fish Audio API usage to stay within your plan limits.

Next Steps

S3 Setup

Configure S3-compatible storage for your audio files

Fish Audio

Learn how to get API keys and choose voices