Skip to content
Latchkey

GitHub Actions Workflow for Run on a Managed Self-Hosted Runner

Run standard CI on a managed self-hosted runner by label.

This workflow is identical to a hosted-runner workflow except runs-on points at a managed runner label.

The workflow

.github/workflows/ci.yml
name: CI
on: [push, pull_request]
jobs:
  build:
    runs-on: latchkey-small
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with: { node-version: 20, cache: npm }
      - run: npm ci
      - run: npm run build
      - run: npm test

Notes

  • Swap the label to move CI off GitHub-hosted runners with no other change.
  • Managed runners give you per-minute savings and transient-failure self-healing.
  • Keep the rest of the workflow portable so you can switch back anytime.

Run it cheaper

Point runs-on: at a Latchkey label to run this workflow at roughly 69% lower per-minute cost, with self-healing for transient failures.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →