Overview
Runloop’s deploy-agent GitHub Action automates agent deployment directly from your GitHub workflows. It provides a convenient way to deploy agents without writing custom API integration code, while maintaining the same functionality as the Agents API.Key Features
- Zero-config Git deployments - Automatically deploys your current repository
- Release tag support - Deploys specific versions when releases are published
- Multiple source types - Git repositories, npm packages, pip packages, tar archives, and single files
- Flexible packaging - Create tar archives however you want in your workflow
- Setup commands - Run custom setup commands after agent installation
- Public/private agents - Control agent visibility
- TTL support - Set expiration time for uploaded objects
Quick Start
Basic Git Deployment
Deploy your current repository as an agent with minimal configuration.Authentication
Setting Up Your API Key
- Go to the Settings page in the Runloop Dashboard
- Create a new API key. For CI/CD workflows, consider using a restricted key scoped to only the resources the workflow needs (for example, Agents: write, Objects: write).
- Add it as a GitHub secret:
- Go to your repository’s Settings → Secrets and variables → Actions
- Click New repository secret
- Name:
RUNLOOP_API_KEY - Value: Your Runloop API key
- Click Add secret
Relationship to Agents API
The GitHub Action provides a convenient wrapper around the Agents API.- For Git sources: Creates an agent with
source.type: "git"and the repository/ref information. When using the API directly, use thereffield for versioning instead of the top-levelversion— see Agent Versioning. - For Tar/File sources:
- Can upload the file/archive as a storage object
- Creates an agent with
source.type: "object"referencing the uploaded object - Applies any setup commands as
agent_setupin the object source
Equivalent API Calls
The GitHub Action deployment.Input Parameters
Outputs
Using Deployment Outputs
Capture and use the agent ID and other outputs from the deployment.Deployment Examples
Git Source (Auto-detect)
Deploy the current repository as an agent. The action automatically detects the repository and tag.Git Source (On Release)
Deploy an agent when a new release is published, using the release tag as the agent name:Git Source (Custom Repository)
Deploy an agent from a specific Git repository and branch:Tar Archive Deployment
Package your agent files into a tar archive and deploy it.Tar Archive with Custom Build
Build your agent with custom steps, then deploy the resulting archive.Single File Deployment
Deploy a single file as an agent.npm Package Deployment
Deploy an agent from an npm package. Useagent-version to pin a specific package version.
pip Package Deployment
Deploy an agent from a PyPI package. Useagent-version to pin a specific package version.
Best Practices
Version Management
- Git agents: Use
git-refto pin to a branch, tag, or tag. Theagent-versionfield is not used. - npm/pip agents: Use
agent-versionto pin the installed package version (e.g.,2.1.123). When omitted, the latest version from the registry is installed. - Tar/file agents: Each upload produces a new immutable object. The
agent-versionfield is not used.
Workflow Organization
- Separate build and deploy: Create separate jobs for building and deploying
- Conditional deployment: Only deploy on specific branches or tags
- Error handling: Add error handling and notifications
Security
- Never commit API keys: Always use GitHub secrets
- Use environment-specific keys: Use different API keys for different environments
- Prefer restricted keys: Create keys with only the permissions your workflow needs to limit exposure if a key is compromised
- Limit secret access: Use environment protection rules for production secrets
Performance
- Cache dependencies: Use GitHub Actions caching for faster builds
- Optimize archive size: Only include necessary files in tar archives
- Use object TTL: Set
object-ttl-daysfor temporary deployments
Troubleshooting
Common Issues
Deployment fails with authentication error- Verify your
RUNLOOP_API_KEYsecret is correctly set - Check that the API key is valid and has the necessary permissions
- Verify the source repository/branch exists and is accessible
- Check that the tar archive or file path is correct
- For npm/pip sources, ensure
agent-versionis a valid package version string
- Verify the commands are valid for the agent’s environment
- Check that required dependencies are available
- Review agent logs in the Runloop Dashboard
Getting Help
- GitHub Action Repository: runloopai/deploy-agent
- Runloop Documentation: Using the Agents API
- Support: support@runloop.ai
Related Documentation
- Using the Agents API - Direct API usage with Python and TypeScript
- Agent Mounts - Mount agents to Devboxes
- Storage Objects - Understanding object storage
