# Migrate from GitHub-hosted runners

Moving a workflow from `ubuntu-latest` to Kajiya is a one-line change. This guide covers what else differs, how to pick sizes, and how to roll out so you can switch back in seconds.

## What stays the same

- Your workflows, actions, secrets, environments and `GITHUB_TOKEN` work as before. Kajiya runners are GitHub self-hosted runners, so GitHub schedules jobs and shows logs as usual.
- Every job gets a fresh machine, as on GitHub-hosted runners: Kajiya boots a new VM per job and destroys it afterwards.
- `actions/cache`, `actions/upload-artifact` and the other GitHub actions keep using GitHub's storage.
- Container jobs and service containers work: Docker Engine is installed.

## What is different

| | GitHub-hosted `ubuntu-latest` | Kajiya |
|---|---|---|
| Price | $0.18 per vCPU-hour ($0.006 per minute for 2 vCPUs) on private repositories; standard runners are free on public ones | $0.0045 per vCPU-hour |
| Memory | 7 GB for the 2-core runner of private repositories | 2 GB per vCPU: 4 GB on `kajiya-2`, 8 GB on `kajiya-4` |
| Image | Large image with many languages and tools | Ubuntu 24.04 with a short list of packages ([what is installed](/docs/runners#preinstalled-software)) |
| Longest job | 6 hours | 58 minutes |
| Location | Azure regions | Seoul, South Korea |
| Operating systems | Linux, Windows, macOS | Linux x86_64 only |

## Step by step

1. **Connect the repositories** with the [GitHub App or a token](/docs/connect-github), and buy a compute pack.
2. **Set a daily cap** under **Limits & alerts** so a mistake cannot burn through the pack ([spend controls](/docs/spend-controls)).
3. **Pick one workflow** that runs often, and change its `runs-on`:

    ```yaml
    jobs:
      test:
        runs-on: kajiya-2   # was: ubuntu-latest
    ```

4. **Add the tools the job assumed.** On GitHub-hosted runners many tools are preinstalled. If the job fails with `command not found`, add the matching setup step:

    ```yaml
        steps:
          - uses: actions/checkout@v4
          - uses: actions/setup-node@v4
            with:
              node-version: 22
          - run: npm ci && npm test
    ```

    Common ones: `actions/setup-node`, `actions/setup-python`, `actions/setup-go`, `actions/setup-java`, `docker/setup-buildx-action`. The GitHub CLI and Docker Compose come from apt: `sudo apt-get update && sudo apt-get install -y gh docker-compose-v2`.

5. **Compare** run time and cost in the dashboard's **Jobs** tab with the same workflow's history on GitHub.
6. **Roll out** to the remaining workflows.

## Keep a way back: a variable for `runs-on`

Read the label from a repository or organization variable, with Kajiya as the default:

```yaml
jobs:
  test:
    runs-on: ${{ vars.CI_RUNNER || 'kajiya-2' }}
```

Setting the variable `CI_RUNNER` to `ubuntu-latest` (repository or organization **Settings → Secrets and variables → Actions → Variables**) moves every workflow back without a commit; deleting it moves them to Kajiya again.

## Choosing sizes

Kajiya charges per vCPU, so a job costs the same whether it runs on 2 vCPUs for 10 minutes or 4 vCPUs for 5 minutes. Pick the size by what the job needs:

- **Memory-bound jobs** (large TypeScript projects, JVM builds, big test suites): start with `kajiya-4` for 8 GB, more than GitHub's 2-core runner has.
- **Parallel builds and test runners** that use every core: `kajiya-8` often finishes in a fraction of the time at a similar cost. New accounts can run `kajiya-8` once they are [established](/docs/queue-and-limits#account-limits).
- **Short jobs** (lint, small checks): `kajiya-2`. Every job is billed at least one minute, and boot is part of it.

## Things to check

- **Jobs longer than 58 minutes** have to be split: see [matrix builds and sharding](/docs/guides/matrix-and-sharding).
- **Downloads from far away.** Package registries and caches outside Asia take longer to reach from Seoul than from a runner next to them. Keep `actions/cache` entries small and cache what you download repeatedly.
- **Network rules.** Private address ranges and a few outbound ports are blocked; see [Runners → Network](/docs/runners#network).
- **Concurrency.** A new account runs 4 vCPUs at once. Jobs beyond that wait on GitHub and start in turn.
- **Public repositories:** require approval for fork pull request workflows ([security](/docs/security#public-repositories-and-forks)).
