runs-on: ubuntu-latestUbuntu is the most common runner for CI workloads.
GitHub-hosted runners, self-hosted runners, job containers, service containers, labels, and operational patterns for GitHub Actions execution.
Pick the right execution environment for the workload.
runs-on: ubuntu-latestUbuntu is the most common runner for CI workloads.
runs-on: [self-hosted, linux, x64]Self-hosted runners are useful for private networks, special hardware, or custom tooling.
container:
image: node:20-bookwormJob containers help standardize tools and dependencies across runs.
Add dependent services and keep runners maintainable.
Use a service container for integration or cache tests.
services:
redis:
image: redis:7
ports:
- 6379:6379Service containers provide disposable dependencies within a single workflow run.
Match jobs to specialized self-hosted infrastructure.
runs-on: [self-hosted, gpu, linux]Runner labels let you route GPU builds, ARM builds, or deployment jobs to the correct machines.
echo "$GITHUB_WORKSPACE"Helpful when debugging path assumptions in containerized or self-hosted environments.