- .gitignore: ignore **/.env and **/app.env so runtime workload env files do not fail appctl clean-tree checks - github_runner/Dockerfile & entrypoint-nix.sh: extend pinned myoung34/github-runner:ubuntu-noble with nixos/nix:2.24.12 seed, /etc/nix/nix.conf, non-root runner ownership, and single-line APP_PRIVATE_KEY_B64 decoding - github_runner/docker-compose.yml: configure EPHEMERAL=true, RUN_AS_ROOT=false, DISABLE_AUTO_UPDATE=true, RUNNER_WORKDIR=/data/work, ../../var/lib/homelab/github_runner:/data, nix-store:/nix, and omit proxy-net for network isolation - github_runner/app.yaml, .env-example, README.md & deployments.yaml: register github_runner (alias gh-runner) in admission registry and document GitHub App org permissions
2.1 KiB
2.1 KiB
GitHub Actions Runner (github_runner)
Ephemeral, Nix-enabled self-hosted GitHub Actions runner built on myoung34/github-runner:ubuntu-noble with Nix (nix-command and flakes enabled) and GitHub App authentication.
Architecture
- Host-Mode Execution (No Docker Socket): Canopy forbids mounting
/var/run/docker.sockor running privileged containers. Workflows run directly inside the runner container as the non-rootrunneruser (RUN_AS_ROOT=false). - Ephemeral Lifecycle (
EPHEMERAL=true): After completing a single job, the runner deregisters and exits0; Docker (restart: unless-stopped) restarts the container andentrypoint-nix.shre-authenticates via the GitHub App for a clean runner instance. - Persistent State & Nix Cache:
- Runner work directory:
../../var/lib/homelab/github_runner:/data(RUNNER_WORKDIR=/data/work). - Nix store cache: named Docker volume
nix-store:/nixso evaluated derivations persist across ephemeral restarts. If/nix/var/nix/profiles/default/bin/nixis missing or broken,entrypoint-nix.shseeds/nixfrom/opt/nix-seed.tar.gzand ensuresrunner:runnerownership.
- Runner work directory:
- Network Isolation: Intentionally not attached to
proxy-net; uses the default isolated Compose bridge for outbound HTTPS to GitHub only.
GitHub App Permissions
Create and install a dedicated GitHub App on your organization (for private repositories):
- Organization permissions:
Self-hosted runners: Read and write - Repository permissions:
Metadata: Read-only
Configuration
See .env-example for required runtime variables (stored in gitignored .env, chmod 0640):
GITHUB_RUNNER_SCOPE:org(default) orrepoGITHUB_RUNNER_ORG_NAME: Target GitHub organization slug (whenorg)GITHUB_RUNNER_APP_ID: GitHub App IDGITHUB_RUNNER_APP_LOGIN: GitHub App slug/loginGITHUB_RUNNER_APP_PRIVATE_KEY_B64: Single-line base64-encoded PEM (base64 -w0 < key.pem), decoded at container startup intoAPP_PRIVATE_KEYfor pure-Python.envcompatibility.GITHUB_RUNNER_LABELS: Comma-separated runner labels (defaultself-hosted,linux,x64,nix).