Github Actions Runner

Deploy a scalable self-hosted GitHub Actions Runner.

Deploy Github Actions Runner

myoung34/github-runner

myoung34/github-runner

Just deployed

GitHub Actions Runner Banner

GitHub Actions Self Hosted Runners

View a complete tutorial here -> https://docs.railway.com/tutorials/github-actions-runners

  1. Setup an ACCESS_TOKEN. This will enable the runner to self register with your GitHub organization or enterprise.
  2. Add any extra labels you want for your runners.
  3. Deploy the template.
  4. Click on your new Service -> Settings -> Regions. Select the region(s) you want and the number of replicas you want.
  5. Deploy the changes and run some GitHub Actions!

Setup a fine-grained PAT

  1. Create a new fine-grained personal access token. Setup -> https://github.com/settings/personal-access-tokens
  2. Set the Resource owner as your organization. Alternatively, you can select your Enterprise or Repo. If you don't then you won't have access to organization scoped runners
  3. Set Expiration
  4. Set Repository Access
  5. Under Permissions, Select Organization Permissions -> Self Hosted Runners -> Read and Write (If Enterprise, select Enterprise instead).
  6. You don't need any other permissions!

Additional Configuration

You can set up additional configuration and settings from the GitHub repo.

Best Practices

Avoid Serverless

Using the Serverless Setting on this Service is not recommended and will result in idle runners disconnecting from GitHub and needing to reauthenticate. GitHub Runners have a 50 second HTTP longpoll which keeps them alive. While the runners in this template can automatically reauth with an ACCESS_TOKEN it will result in offline / abandoned runners.

Avoid Docker-in-Docker

Railway's current container model does not allow for docker containers inside its containers, which means any GitHub Actions workflow that pulls a container and runs it will fail.

About GitHub Runners on Railway

Deploying GitHub Actions Self Hosted Runners on Railway is an excellent way to run your own CI infrastructure because you only pay for what you use. With self-hosted runners, you also unlock the ability to cache expensive and time-consuming dependencies (node_modules, cargo, etc.) or large git repositories. Best of all, Railway's built-in replicas means you can scale your runners horizontally, or even distribute them to different data centers with just a click and redeploy. You'll save build times and costs over using standard runners, AND you'll unlock more sophistocated workflows -- without needing a PhD in DevOps.


Template Content

myoung34/github-runner

myoung34/github-runner

More templates in this category

View Template

Postgres S3 backups

A simple NodeJS app to back up your PostgreSQL database to S3 via a cron


View Template

Tier

A single tool to configure,orchestrate and manage your entire pricing stack


View Template

Trigger.dev

Open source background jobs framework for TypeScript.