This project enables you to deploy GitHub Actions runners on Hathora Cloud, allowing you to run GitHub Actions workflows in a scalable and managed environment.
- A Hathora account
- A GitHub organization with admin access
- A GitHub token with appropriate permissions (see Setup section)
- Docker installed locally
-
Generate GitHub Token
- Create a Personal Access Token (PAT) in GitHub with the
admin:org
scope - Alternatively, you can use a GitHub App with the following permissions:
actions:read
andactions:write
for runner managementmetadata:read
for repository access
- Store this token securely as you'll need it for deployment
- Create a Personal Access Token (PAT) in GitHub with the
-
Create a Hathora Application
- Log in to the Hathora Console
- Create a new application
-
Configure Environment Variables Go to the "Settings" pane for your Application in Hathora and add the following environment variables
GITHUB_TOKEN=your_github_token GITHUB_ORG=your_organization_name
The deployment consists of two main components:
-
Dockerfile: Based on the official GitHub Actions runner image, it sets up the environment for running GitHub Actions.
-
init.sh: A startup script that:
- Generates a unique runner name
- Obtains JIT (Just-In-Time) configuration from GitHub
- Starts the runner with the obtained configuration
HATHORA_PROCESS_ID
: Automatically set by Hathora, used to generate unique runner namesHATHORA_REGION
: Automatically set by Hathora, indicates the deployment regionGITHUB_TOKEN
: Your GitHub token with appropriate permissionsGITHUB_ORG
: Your GitHub organization name
- Use the minimum required token permissions for your use case:
- For organization-level runners:
admin:org
scope - For repository-level runners:
repo
scope - Consider using GitHub Apps for better security and granular permissions
- For organization-level runners:
- Each runner is ephemeral and gets a unique name
- The runner automatically registers with your organization using JIT configuration
- Regularly rotate your tokens and monitor their usage
If you encounter issues:
- Check the Hathora logs for any deployment errors
- Verify your GitHub token has the correct permissions
- Ensure your organization name is correct
- Check that the runner is properly registered in your GitHub organization's settings
This project is open source and available under the MIT License.