Files
proxmox/scripts/dev-vm/setup-act-runner.sh
defiQUG 5618f95426
All checks were successful
Deploy to Phoenix / deploy (push) Successful in 4s
Add Gitea act runner bootstrap tooling
2026-03-29 01:23:57 -07:00

38 lines
1.2 KiB
Bash

#!/usr/bin/env bash
# Install and register act_runner for Gitea Actions on dev-vm (5700).
# Usage: GITEA_RUNNER_REGISTRATION_TOKEN=xxx bash setup-act-runner.sh
# Get token: https://gitea.d-bis.org/-/admin/actions/runners
set -euo pipefail
ACT_RUNNER_VERSION="${ACT_RUNNER_VERSION:-0.2.13}"
# Gitea root URL as seen from this host (same LXC as Gitea → 127.0.0.1)
INSTANCE="${INSTANCE:-http://127.0.0.1:3000}"
WORK_DIR="${WORK_DIR:-/opt/act_runner}"
TOKEN="${GITEA_RUNNER_REGISTRATION_TOKEN:-}"
# Workflows commonly use runs-on: ubuntu-latest; labels must match.
RUNNER_LABELS="${RUNNER_LABELS:-ubuntu-latest}"
if [ -z "$TOKEN" ]; then
echo "Set GITEA_RUNNER_REGISTRATION_TOKEN"
exit 1
fi
mkdir -p "$WORK_DIR"
cd "$WORK_DIR"
ARCH=$(uname -m)
case "$ARCH" in x86_64) ARCH="amd64" ;; aarch64|arm64) ARCH="arm64" ;; *) echo "Unsupported: $ARCH"; exit 1 ;; esac
BINARY="act_runner-${ACT_RUNNER_VERSION}-linux-${ARCH}"
URL="https://dl.gitea.com/act_runner/${ACT_RUNNER_VERSION}/${BINARY}"
if [ ! -f "./act_runner" ]; then
curl -sL -o act_runner "$URL"
fi
chmod +x ./act_runner
if [ ! -f .runner ]; then
./act_runner register --no-interactive --instance "$INSTANCE" --token "$TOKEN" --labels "$RUNNER_LABELS"
fi
echo "Ready. Run: ./act_runner daemon"