Quick Start
Add Geni to your workflow file:Action Inputs
The Geni GitHub Action accepts the following inputs:The URL for accessing your database. Should be stored in GitHub Secrets.Examples:
- PostgreSQL:
postgres://user:password@host:5432/database?sslmode=disable - MySQL:
mysql://root:password@localhost:3306/app - MariaDB:
mariadb://root:password@localhost:3307/app - SQLite:
sqlite://./database.sqlite - LibSQL/Turso:
https://my-db.turso.io
Authentication token for LibSQL/Turso databases. Required only when authenticating to Turso. Store in GitHub Secrets.
The path to where your migration files are located.
The name of the table used to track migration history.
Time in seconds to wait before attempting to connect to the database. Useful when the database needs time to boot.
Complete Examples
Basic PostgreSQL Migration
With Turso/LibSQL
Custom Migration Table
Multi-Database Deployment
Run migrations against multiple databases in parallel:How It Works
The GitHub Action performs the following steps:Download Geni Binary
The action detects your runner’s operating system (Linux, macOS, or Windows) and downloads the latest Geni release from GitHub.
Set Environment Variables
Your inputs are converted to environment variables:
DATABASE_URLDATABASE_TOKENDATABASE_MIGRATIONS_FOLDERDATABASE_MIGRATIONS_TABLEDATABASE_WAIT_TIMEOUTDATABASE_NO_DUMP_SCHEMA(set tofalse)
Setting Up Secrets
Add Database URL
Click New repository secret and add:
- Name:
DATABASE_URL - Value: Your database connection string
Testing Migrations
Test migrations in pull requests before merging:Troubleshooting
Action fails to download binary
Action fails to download binary
Ensure your workflow has internet access and can reach GitHub releases. Check if your organization has any proxy or firewall restrictions.
Connection timeout errors
Connection timeout errors
Increase the
wait_timeout value, especially when using database services that need initialization time:Migration files not found
Migration files not found
Verify the
migrations_folder path is correct relative to your repository root. Ensure the checkout action runs before Geni:Permission denied errors
Permission denied errors
This typically occurs on self-hosted runners. The action handles making the binary executable, but ensure your runner has appropriate permissions.
Best Practices
Use Specific Versions
Instead of
@main, pin to a specific version:Separate Environments
Use different secrets for staging and production databases.
Run on Deployment
Trigger migrations only on successful deployments, not on every push.
Enable Notifications
Configure workflow notifications to alert on migration failures.