Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
Co-authored-by: Cursor <cursoragent@cursor.com>
35 lines
1.0 KiB
Bash
35 lines
1.0 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}"
|
|
INSTANCE="${INSTANCE:-http://192.168.11.59:3000}"
|
|
WORK_DIR="${WORK_DIR:-/opt/act_runner}"
|
|
TOKEN="${GITEA_RUNNER_REGISTRATION_TOKEN:-}"
|
|
|
|
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"
|
|
fi
|
|
echo "Ready. Run: ./act_runner daemon"
|