feat: migrate CI to Codeberg Actions and add self-hosted runner config
- Added .forgejo/workflows/ci.yml for thin CI orchestration. - Configured Dockerized Codeberg runner with Nix support in codeberg-runner/. - Added systemd service for persistent runner execution. - Added GEMINI.md for project CI/Nix conventions. - Added Taskfile task for Linux release builds.
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
# Dockerfile for a Codeberg Runner with Nix installed
|
||||
FROM gitea/act_runner:latest
|
||||
|
||||
# Install Nix requirements and basic tools
|
||||
RUN apt-get update && apt-get install -y curl xz-utils sudo && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install Nix in single-user mode (suitable for container)
|
||||
# We use the Determinate Systems installer for reliability
|
||||
RUN curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install linux \
|
||||
--init none \
|
||||
--no-confirm
|
||||
|
||||
# Add Nix to PATH
|
||||
ENV PATH="/nix/var/nix/profiles/default/bin:${PATH}"
|
||||
ENV NIX_PATH="nixpkgs=channel:nixos-unstable"
|
||||
|
||||
# Ensure the runner user can use Nix
|
||||
RUN echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf
|
||||
@@ -0,0 +1,16 @@
|
||||
[Unit]
|
||||
Description=Codeberg CI Runner (Docker Compose)
|
||||
Requires=docker.service
|
||||
After=docker.service network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=/home/picoclaw/projects/sharedinbox3/codeberg-runner
|
||||
ExecStartPre=-/usr/bin/docker compose down
|
||||
ExecStart=/usr/bin/docker compose up --build
|
||||
ExecStop=/usr/bin/docker compose down
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,19 @@
|
||||
services:
|
||||
runner:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
restart: always
|
||||
env_file:
|
||||
- ../.env
|
||||
environment:
|
||||
- GITEA_INSTANCE_URL=${CODEBERG_INSTANCE_URL:-https://codeberg.org}
|
||||
- GITEA_RUNNER_REGISTRATION_TOKEN=${CODEBERG_CI_RUNNER_TOKEN}
|
||||
- GITEA_RUNNER_NAME=${CODEBERG_RUNNER_NAME:-laptop-runner}
|
||||
- GITEA_RUNNER_LABELS=${CODEBERG_RUNNER_LABELS:-self-hosted,linux,nix}
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- ./runner-data:/data
|
||||
# Use host network if you want to access local services easily,
|
||||
# but for most cases the default bridge is fine.
|
||||
# network_mode: host
|
||||
Reference in New Issue
Block a user