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 testNotes
- 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
How to Speed Up GitHub Actions: 9 High-Impact TacticsMake GitHub Actions faster: caching, parallelization, test splitting, Docker layer caching, slimmer images, a…
GitHub Actions Cost Calculator - Estimate & Cut Your CI BillFree GitHub Actions cost calculator: enter your monthly CI minutes and runner size to see your current bill a…