diff --git a/docker/act_runner.compose.yml b/docker/act_runner.compose.yml new file mode 100644 index 0000000..cd09028 --- /dev/null +++ b/docker/act_runner.compose.yml @@ -0,0 +1,29 @@ +version: "3" + +# Gitea act_runner - to be deployed on Unraid (or any Docker host). +# Allows Gitea Actions workflows to run and build Docker images automatically. +# +# Setup steps: +# 1. Copy this file to /mnt/user/appdata/act_runner/docker-compose.yml +# 2. Register the runner to get a token: +# docker run --rm -it gitea/act_runner:latest \ +# register --no-interactive \ +# --instance http://10.111.111.4:3000 \ +# --token \ +# --name unraid-runner \ +# --labels ubuntu-latest:docker://node:16-bullseye +# (get the registration token from forge.dilain.com → Settings → Actions → Runners) +# 3. Copy the generated .runner file into /mnt/user/appdata/act_runner/ +# 4. Start: docker compose up -d + +services: + act_runner: + image: gitea/act_runner:latest + container_name: act_runner + restart: unless-stopped + environment: + - DOCKER_HOST=unix:///var/run/docker.sock + volumes: + - /mnt/user/appdata/act_runner:/data + - /var/run/docker.sock:/var/run/docker.sock + working_dir: /data diff --git a/docker/build-and-push.sh b/docker/build-and-push.sh new file mode 100755 index 0000000..fade075 --- /dev/null +++ b/docker/build-and-push.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# Build and push nabarr Docker image to the Gitea container registry. +# Run this script on any machine that has Docker and can reach forge.dilain.com. +# +# Usage: +# ./docker/build-and-push.sh [TAG] +# TAG defaults to "latest" +# +# Example: +# ./docker/build-and-push.sh +# ./docker/build-and-push.sh master + +set -e + +REGISTRY="forge.dilain.com" +IMAGE="${REGISTRY}/laurent/nabarr" +TAG="${1:-latest}" + +REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)" + +echo "==> Building ${IMAGE}:${TAG}" +docker build \ + --platform linux/amd64 \ + -t "${IMAGE}:${TAG}" \ + -f "${REPO_ROOT}/docker/Dockerfile" \ + "${REPO_ROOT}" + +echo "==> Pushing ${IMAGE}:${TAG}" +docker push "${IMAGE}:${TAG}" + +echo "==> Done: ${IMAGE}:${TAG}"