# GitHub Actions workflow examples

> Copy-paste GitHub Actions workflows for flockvm runners: Node, Python, Docker builds, Playwright, a matrix by size, and moving from ubuntu-latest.

- URL: https://flockvm.com/docs/ci/workflows
- Section: GitHub Actions
- Last updated: 2026-11-10

These workflows run as they are on flockvm: put them in `.github/workflows/` of a connected private repository. Most workflows written for `ubuntu-latest` only need their `runs-on` changed; the last section lists what differs.

## What's in the runner image

Every job runs on `ubuntu-26.04-runner`, an Ubuntu 26.04 LTS image built to match GitHub's `ubuntu-26.04`, the image `ubuntu-latest` is moving to in a migration GitHub runs from 2026-10-19 to 2026-11-19: a workflow written for GitHub finds the same tools, at the same paths, with the same defaults. It follows GitHub's list in [actions/runner-images](https://github.com/actions/runner-images) (`Ubuntu2604-Readme.md` and `toolset-2604.json`, image 20261026.180.1). The versions below are those of the build of 2026-11-01.

| Area                  | Preinstalled                                                                                                                                                                                                                                                                                                                           |
| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Runner                | `actions/runner` 2.338.2, run as user `runner` (uid 1001, like GitHub's), home `/home/runner`, passwordless `sudo`, groups `docker`, `adm` and `systemd-journal`                                                                                                                                                                       |
| Node.js               | Node.js 24 (the default `node`, as on GitHub's 26.04) with npm, yarn 1.22 and n; nvm                                                                                                                                                                                                                                                   |
| Tool cache            | Node.js 22, 24 and 26; Python 3.11 to 3.15; PyPy 3.9 to 3.11; Go 1.24 to 1.26; Ruby 3.2 to 4.0; Temurin 11, 17, 21 and 25                                                                                                                                                                                                              |
| Languages             | Java (Temurin 25 by default, 11, 17 and 21 too, `JAVA_HOME_<n>_X64`) with Maven 3.10, Gradle 9.8 and Ant; Python 3.14 (`python` and `python3`) with pip and pipx; Go 1.26; .NET SDK 10; Rust 1.99 with rustfmt and clippy; Ruby 3.3; PHP 8.5 with Composer and PHPUnit; Kotlin; Bazel through Bazelisk; PowerShell 7.6 (`shell: pwsh`) |
| Compilers             | GCC, G++ and gfortran 13, 14 and 15 (default); Clang, LLD, clang-format and clang-tidy 20, 21 (default) and 22, LLDB 21; CMake 4.4; Ninja                                                                                                                                                                                              |
| Browsers              | Google Chrome and ChromeDriver, Chromium, Microsoft Edge and EdgeDriver, Firefox and geckodriver, Selenium server                                                                                                                                                                                                                      |
| Containers            | `docker-ce` 29 with the **buildx** and **compose** plugins (`runner` is in the `docker` group, the daemon starts on first use); Podman 5.7 (rootless, with custom networks), Buildah, Skopeo                                                                                                                                           |
| Cloud and Kubernetes  | AWS CLI, Session Manager plugin and SAM CLI, Azure CLI, Google Cloud CLI, Packer, Ansible; kubectl, kind, minikube, kustomize, Helm 4                                                                                                                                                                                                  |
| Databases and servers | PostgreSQL 18, MySQL 8.4 (user `root`, password `root`), nginx, Apache: installed and stopped, as on GitHub. Start one with `sudo systemctl start postgresql.service`                                                                                                                                                                  |
| Git and tools         | git 2.56 (from the git-core PPA), git-lfs, `gh`, `jq`, `yq`, ShellCheck, `sqlite3`, `zstd`, `7z`, `parallel`, Xvfb, Homebrew (not in `PATH`, as on GitHub), and the build packages of GitHub's list                                                                                                                                    |
| System                | `apt-get install` works without `apt-get update` first (package lists are kept, as on GitHub), `add-apt-repository`, `snap install` (snapd starts on first use; no snap preinstalled); `/tmp` is on the disk, not in RAM                                                                                                               |

The tool cache is `/opt/hostedtoolcache` (`RUNNER_TOOL_CACHE`), and `ImageOS` is `ubuntu26`, so `actions/setup-node`, `setup-python`, `setup-go`, `setup-java` and `ruby/setup-ruby` find the versions above without downloading. Another version is downloaded in the job. The builds `setup-python` and `ruby/setup-ruby` download for Ubuntu 26.04 need a CPU with AVX2 (x86-64-v3). The runners' host in France has one (AMD Ryzen 9 9900X); the Paris host, where runners ran until 2026-11-10, did not, and another Python or Ruby version stopped there with `CPU ISA level is lower than required`. The ones in the tool cache run on any x86-64 CPU. The archives of common actions (`actions/checkout`, the `setup-*` actions…) are in the image too (`ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE`), so the runner does not download them for each job.

**Left out, though GitHub's `ubuntu-26.04` has them**: the Android SDK and NDK, Haskell (GHC, Cabal, Stack), Swift, PowerShell's modules (Az, Graph, Pester, PSScriptAnalyzer), the CodeQL bundle, vcpkg, .NET 8 and 9 (`actions/setup-dotnet` installs them), the nbgv tool, the Azure DevOps CLI extension, AzCopy, Bicep, and the Copilot CLI of the tool cache. GitHub's Docker images are not pre-pulled.

**Different from GitHub's**: Docker 29.9 and compose 5.6 (GitHub pins 29.4 and 5.1), Maven 3.10 (3.9 on GitHub), pipx 1.8 (1.17), git-lfs 3.7 (3.8); Node.js 26 is in the tool cache too; Docker starts on first use instead of at boot; `ImageVersion` is `flock-<build date>-full`.

GitHub's 26.04 image itself no longer has Java 8, Pulumi, Julia, Miniconda, Mercurial or the npm globals other than n and yarn (TypeScript, webpack, gulp…), so neither has this one.

### Moving a workflow from Ubuntu 24.04

Until 2026-11-01 flockvm jobs ran on an Ubuntu 24.04 image modeled on GitHub's `ubuntu-24.04`. Most workflows run unchanged on 26.04. Check these if yours relied on what the system had rather than on a `setup-*` action:

| On the 24.04 image                              | On the 26.04 image                                                                               | What to do                                                                                                                                                                           |
| ----------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Node.js 22 by default                           | Node.js 24                                                                                       | `actions/setup-node` with `node-version: 22` (in the tool cache, no download)                                                                                                        |
| Java 17 by default, Temurin 8 in the tool cache | Java 25 by default, no Java 8                                                                    | `actions/setup-java` with your version; Java 8 is downloaded                                                                                                                         |
| Python 3.12                                     | Python 3.14                                                                                      | `actions/setup-python` (3.11 to 3.15 are in the tool cache)                                                                                                                          |
| Go 1.24, GCC 13, Clang 18, CMake 3.31           | Go 1.26, GCC 15, Clang 21, CMake 4.4                                                             | `actions/setup-go`, `gcc-13`/`g++-13`, `clang-20`; CMake 4 refuses projects that ask for a `cmake_minimum_required` below 3.5: pass `-DCMAKE_POLICY_VERSION_MINIMUM=3.5` or raise it |
| PostgreSQL 16, MySQL 8.0                        | PostgreSQL 18, MySQL 8.4                                                                         | A `services:` container pins the version you test against                                                                                                                            |
| Ruby 3.2, PHP 8.3, Helm 3, Pulumi               | Ruby 3.3, PHP 8.5, Helm 4, no Pulumi                                                             | `ruby/setup-ruby`, `shivammathur/setup-php`, `azure/setup-helm`, `pulumi/actions`                                                                                                    |
| `ImageOS` `ubuntu24`                            | `ubuntu26`                                                                                       | Cache keys built from `ImageOS` miss once, then fill again                                                                                                                           |
| GNU coreutils                                   | `ls`, `cat`, `sort` and most other coreutils are the Rust rewrite (uutils), as on GitHub's 26.04 | Rarely matters; a script that depends on an exact GNU output or option may need a change                                                                                             |

A workflow that must stay on Ubuntu 24.04 can keep `runs-on: ubuntu-24.04` on GitHub-hosted runners: flockvm has no 24.04 runner any more.

## Node.js

**npm:**

```yaml title="npm"
name: Node CI
on: [push, pull_request]

jobs:
  test:
    runs-on: flockvm
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 22
          cache: npm
      - run: npm ci
      - run: npm test
```

**pnpm:**

```yaml title="pnpm"
name: Node CI
on: [push, pull_request]

jobs:
  test:
    runs-on: flockvm
    steps:
      - uses: actions/checkout@v4
      - uses: pnpm/action-setup@v4
        with:
          version: 9
      - uses: actions/setup-node@v4
        with:
          node-version: 22
          cache: pnpm
      - run: pnpm install --frozen-lockfile
      - run: pnpm test
```

**System Node:**

```yaml title="System Node"
name: Node CI
on: [push, pull_request]

jobs:
  test:
    runs-on: flockvm
    steps:
      - uses: actions/checkout@v4
      # Node.js 24 is the default node: no setup step needed.
      - run: node --version
      - run: npm ci
      - run: npm test
```

> **Tip:** Each job starts on a new VM with an empty npm cache. `cache: npm` saves npm's download cache to GitHub's Actions cache at the end of a job and restores it at the start of the next one, so `npm ci` takes packages from that cache instead of fetching each one from the npm registry.

## Python

**pip + pytest:**

```yaml title="pip + pytest"
name: Python CI
on: [push, pull_request]

jobs:
  test:
    runs-on: flockvm
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: "3.12"
          cache: pip
      - run: pip install -r requirements.txt
      - run: pytest -q
```

**System Python:**

```yaml title="System Python"
name: Python CI
on: [push, pull_request]

jobs:
  test:
    runs-on: flockvm
    steps:
      - uses: actions/checkout@v4
      - run: python -m venv .venv
      - run: .venv/bin/pip install -r requirements.txt
      - run: .venv/bin/pytest -q
```

## Docker

Docker, buildx and compose are preinstalled, and the `runner` user can use them without `sudo`.

**docker build:**

```yaml title="docker build"
name: Docker
on: [push]

jobs:
  build:
    runs-on: flockvm-large
    steps:
      - uses: actions/checkout@v4
      - run: docker build -t app:${{ github.sha }} .
      - run: docker run --rm app:${{ github.sha }} npm test
```

**buildx + push:**

```yaml title="buildx + push"
name: Docker
on:
  push:
    branches: [main]

jobs:
  image:
    runs-on: flockvm-large
    permissions:
      contents: read
      packages: write
    steps:
      - uses: actions/checkout@v4
      - uses: docker/setup-buildx-action@v3
      - uses: docker/login-action@v3
        with:
          registry: ghcr.io
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}
      - uses: docker/build-push-action@v6
        with:
          context: .
          push: true
          tags: ghcr.io/${{ github.repository }}:${{ github.sha }}
```

**compose:**

```yaml title="compose"
name: Integration tests
on: [push, pull_request]

jobs:
  integration:
    runs-on: flockvm
    steps:
      - uses: actions/checkout@v4
      - run: docker compose up -d --wait
      - run: npm ci && npm run test:integration
      - if: always()
        run: docker compose logs
```

> **Note: No layer cache between jobs.** Each job starts with an empty Docker daemon: no image and no layer from an earlier job. Every `FROM` image is pulled again. If your builds are slow because of it, use a registry cache, for example `cache-from` and `cache-to` with `type=registry` in `docker/build-push-action`.

## Playwright and browsers

Chrome, Chromium, Edge and Firefox are preinstalled, but Playwright runs its own builds of each browser, matched to its version. `npx playwright install --with-deps` downloads them; the job has passwordless `sudo`, so the system libraries install too.

```yaml title=".github/workflows/e2e.yml"
name: E2E
on: [push, pull_request]

jobs:
  e2e:
    runs-on: flockvm
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 22
          cache: npm
      - run: npm ci
      - run: npx playwright install --with-deps chromium
      - run: npx playwright test
      - uses: actions/upload-artifact@v4
        if: failure()
        with:
          name: playwright-report
          path: playwright-report/
```

Install only the browsers you test with: each one is downloaded again in every job. A Selenium or Puppeteer suite can use the preinstalled Chrome and ChromeDriver instead.

## A matrix by size

Use the label as a matrix dimension to compare sizes, or to spread a test suite.

```yaml title=".github/workflows/matrix.yml"
name: Matrix
on: [push]

jobs:
  test:
    strategy:
      fail-fast: false
      matrix:
        runner: [flockvm-small, flockvm, flockvm-large]
        node: [22, 24]
    runs-on: ${{ matrix.runner }}
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: ${{ matrix.node }}
      - run: npm ci
      - run: npm test -- --maxWorkers="$(nproc)"
```

Six jobs, six VMs. They queue on flockvm like any jobs: see [Limits](https://flockvm.com/docs/ci/limits#concurrent-runners).

## Moving from ubuntu-latest

Change `runs-on`, then check these differences.

```diff title=".github/workflows/ci.yml"
 jobs:
   test:
-    runs-on: ubuntu-latest
+    runs-on: flockvm
     steps:
       - uses: actions/checkout@v4
```

| On GitHub-hosted                                                     | On flockvm                                                                                                     | What to do                                                    |
| -------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
| The full `ubuntu-26.04` image                                        | The same tools, without Android, Haskell, Swift, PowerShell's modules, CodeQL, vcpkg and .NET 8/9 (list above) | `sudo apt-get install` or a `setup-*` action for one of those |
| The tool cache holds common versions of Node, Python, Go, Ruby, Java | The same versions, plus Node.js 26                                                                             | Nothing                                                       |
| Public and private repositories                                      | Private repositories only                                                                                      | Keep public repositories on GitHub-hosted runners             |
| Linux, Windows, macOS, arm64                                         | Linux x64 only                                                                                                 | Keep other platforms on GitHub-hosted runners                 |
| Billed per minute, rounded up                                        | Billed per second, the VM's whole life                                                                         | Nothing                                                       |

Things that work the same: `actions/checkout`, `actions/cache`, `actions/upload-artifact`, secrets, `GITHUB_TOKEN`, `permissions:` and `sudo`.

What the switch saves, against GitHub and other runner providers, is worked out in [cheap GitHub Actions runners](https://flockvm.com/compare/cheap-github-actions-runners); [GitHub Actions runners on Firecracker](https://flockvm.com/github-actions-runners) sums up flockvm's runners on one page.

> **Warning:** Nothing a job downloads is kept for the next one on flockvm: no Docker layers, no `node_modules`, no version a `setup-*` action fetched beyond the tool cache above. Each job is a fresh VM. Use `actions/cache` (or the `cache:` option of `setup-*` actions) for dependency caches.

## Next steps

- [Labels and prices](https://flockvm.com/docs/ci/labels): Every label and what it costs.
- [Limits](https://flockvm.com/docs/ci/limits): Timeouts, queueing, cold boots.
- [Troubleshooting](https://flockvm.com/docs/ci/troubleshooting): When a job does not start or fails.
