GitHub Actions: Runners, Containers, Services, and Self-Hosted Execution

GitHub-hosted runners, self-hosted runners, job containers, service containers, labels, and operational patterns for GitHub Actions execution.

View
StandardDetailedCompact
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all
## Choosing and targeting runners
Use a GitHub-hosted Ubuntu runner
runs-on: ubuntu-latest

# Run a job on Linux.

Target a self-hosted runner
runs-on: [self-hosted, linux, x64]

# Run on infrastructure you manage.

Run the job inside a container
container:
  image: node:20-bookworm

# Use a container image as the job runtime.

## Services and operational patterns
Start a Redis service for tests
services:
  redis:
    image: redis:7
    ports:
      - 6379:6379

# Use a service container for integration or cache tests.

Label-based runner targeting
runs-on: [self-hosted, gpu, linux]

# Match jobs to specialized self-hosted infrastructure.

Inspect the workspace path
echo "$GITHUB_WORKSPACE"

# Print the checkout path on the runner.

Recommended next

No recommendations yet.