Skip to content

GitHub Actions

Migrate from GitHub-hosted runners

Move GitHub Actions jobs from ubuntu-latest to flockvm step by step: install the App, change runs-on per job, matrices, fallbacks and a cost estimate.

This guide moves the Linux jobs of a GitHub organization from GitHub-hosted runners to flockvm, one job at a time, and keeps everything flockvm does not run on GitHub. Nothing changes in your steps: only the runs-on: line of each job you move.

Before you start

Check that your jobs fit what flockvm runs today. A job that does not fit stays on GitHub-hosted runners, in the same workflow.

Check flockvm today
Repository Private only. A job from a public repository fails at once, with no VM and no charge.
Platform Linux x64 only, Ubuntu 26.04. No arm64, macOS or Windows runner.
Size Up to 8 vCPU: flockvm-small, flockvm, flockvm-large.
Jobs at once At most 4 runner VMs on the host, across all organizations. More jobs queue, oldest first.
Cache None kept between jobs: restore it with actions/cache or the cache: option of setup-*.
Job length 6 hours at most.
Plan CI jobs run from the paid plan. During the free trial you can connect GitHub, but jobs are held.

The full list, with queueing and cold boots, is on Limits.

You also need the right roles on both sides: an owner or admin of the flockvm organization, and an owner of the GitHub organization (see Connect GitHub).

Step by step

  1. Install the flockvm GitHub App

    On the CI page of the dashboard, press Connect GitHub, pick your GitHub organization and the repositories whose jobs may run on flockvm. Install it once per GitHub organization: every selected repository then bills the same flockvm organization. Connect GitHub walks through each screen.

  2. Run one job by hand

    Before you touch a real workflow, run a smoke test in one of the selected repositories:

    .github/workflows/flockvm-smoke.yml
    name: flockvm smoke test
    on: workflow_dispatch
    
    jobs:
      hello:
        runs-on: flockvm-small
        steps:
          - uses: actions/checkout@v4
          - run: uname -a && nproc && free -g && docker version

    Start it from the repository's Actions tab. It shows on the CI page within seconds, with its status, duration and cost.

  3. Change runs-on, job by job

    Move one job, push, compare the run with the last one on GitHub, then move the next.

    .github/workflows/ci.yml
     jobs:
       test:
    -    runs-on: ubuntu-latest
    +    runs-on: flockvm
         steps:
           - uses: actions/checkout@v4
           - run: make test

    Pick the label with as many vCPUs as the GitHub-hosted runner you leave:

    You run on GitHub's vCPU · RAM Move to flockvm vCPU · RAM
    ubuntu-latest, ubuntu-26.04 (standard, 2-core in private repositories) 2 · 8 GB flockvm-small 2 · 4 GB
    A 4-core larger runner 4 · 16 GB flockvm 4 · 8 GB
    An 8-core larger runner 8 · 32 GB flockvm-large 8 · 16 GB

    Each label has as many vCPUs as the GitHub runner it replaces, and half its RAM. A job that needs the memory (a large build, a browser test suite, a big Docker build) moves one label up: from the 2-core runner to flockvm (4 vCPU, 8 GB), the same RAM, and it still costs less than GitHub's 2-core runner: $0.004 a minute against $0.006. The prices are on Labels and prices.

  4. Restore caches and set timeouts

    Each job is a fresh VM: no node_modules, no Docker layers from the last run. Turn on cache: in actions/setup-node (or setup-python, setup-go…), use actions/cache for the rest, and cache-from / cache-to with type=registry for Docker builds. Add timeout-minutes so a stuck job stops before 6 hours. Workflows lists what differs in the image.

  5. Watch the first week

    The CI page lists every job with its repository, label, time queued, duration and cost, and charts the CI spend per day. Jobs that wait long in Queued are a sign that too many run at once: see Matrices below.

Matrices

A matrix works as it is: its jobs queue and run in turn on flockvm. Since the host runs at most 4 runner VMs at once, cap the matrix so one workflow does not take every slot:

jobs:
  test:
    runs-on: flockvm
    strategy:
      max-parallel: 2
      matrix:
        node: [22, 24, 26]
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: ${{ matrix.node }}
          cache: npm
      - run: npm ci && npm test

A matrix over platforms keeps the jobs flockvm does not run on GitHub. Put the runner in the matrix:

jobs:
  build:
    strategy:
      matrix:
        include:
          - runner: flockvm          # Linux x64 on flockvm
          - runner: ubuntu-24.04-arm # arm64 stays on GitHub
          - runner: macos-latest     # macOS stays on GitHub
    runs-on: ${{ matrix.runner }}
    steps:
      - uses: actions/checkout@v4
      - run: make build

If your workflows often run more than 4 Linux jobs at once, keep part of them on GitHub-hosted runners for now, or expect them to wait their turn.

Fallbacks to GitHub-hosted runners

One switch for the whole organization

Put the runner in a GitHub configuration variable instead of the workflow. Create an organization variable, for example LINUX_RUNNER set to flockvm, and give it access to your private repositories only (or to the repositories you selected for the App). Then write each job as:

jobs:
  test:
    runs-on: ${{ vars.LINUX_RUNNER || 'ubuntu-latest' }}

On GitHub Free, organization variables do not reach private repositories: set the same variable on each repository instead. A repository the variable does not reach, a public one for example, runs on ubuntu-latest. To move every job back to GitHub at once, set the variable to ubuntu-latest: no workflow to edit. A repository variable of the same name overrides the organization's, for one repository.

Public repositories

flockvm never runs a public repository's jobs: anyone can open a pull request on it. A workflow shared between public and private repositories can also choose from the event, on push and pull_request:

runs-on: ${{ github.event.repository.private && 'flockvm' || 'ubuntu-latest' }}

arm64, macOS and Windows

Keep those jobs on the GitHub-hosted labels they use today (ubuntu-24.04-arm, macos-latest, windows-latest…), in the same workflow as your flockvm jobs. Only jobs whose runs-on asks for a flockvm label come to flockvm; every other job runs on GitHub as before.

Moving away again

Disconnecting GitHub on the CI page stops flockvm from taking new jobs. Jobs that still ask for a flockvm label then stay queued on GitHub, so switch their runs-on back first, or flip the organization variable above.

Estimate the cost

A flockvm job bills its VM's whole life, by the second: your steps plus about 25 seconds for the VM to boot and register the runner. GitHub rounds each job up to the whole minute.

  1. In your GitHub organization's billing settings, read last month's Actions usage on Linux: the number of jobs and the minutes per runner size.
  2. For each label, add 25 seconds per job to the minutes, and multiply by the label's price per minute.
  3. Add the plan: $18 a month per organization, which comes back in full as VM and CI time. Usage past it comes from the prepaid wallet.

An example: 2,000 jobs a month of 4 minutes each on a 4-core runner.

GitHub-hosted, 4-core flockvm, flockvm
Billed time 2,000 × 4 min = 8,000 min 2,000 × (240 s + 25 s) = 530,000 s, about 8,833 min
Price per minute $0.012 $0.004
Runner cost $96.00 $35.33
Your month on flockvm $18 plan + $17.33 from the wallet = $35.33

Short jobs save more per minute, since GitHub bills a 20-second job a whole minute: $0.006 on its 2-core runner, about $0.0015 on flockvm-small. To GitHub, a flockvm runner is a self-hosted runner, so these jobs do not use your GitHub plan's included Actions usage. The pricing page has more worked examples, and GitHub Actions pricing, explained covers GitHub's side of the bill. To cut the minutes themselves, see how to speed up GitHub Actions.

Checklist for a team

  • The App is installed on the GitHub organization, with the repositories that should run on flockvm.
  • The flockvm plan has started, and auto top-up is on if CI runs every day (Plan and wallet).
  • Linux jobs of private repositories ask for a flockvm label, or for vars.LINUX_RUNNER.
  • arm64, macOS, Windows and public-repository jobs stay on GitHub-hosted labels.
  • Caches are restored explicitly, and every job has a timeout-minutes.
  • Wide matrices have a max-parallel.
  • Your teammates are members of the flockvm organization, so they can follow jobs on the CI page (Members and roles).

Connecting and disconnecting GitHub are recorded in the organization's audit log.

Next steps