Skip to content

Instantly share code, notes, and snippets.

@tvarohohlavy
Last active July 16, 2024 23:16
Show Gist options
  • Save tvarohohlavy/85e9ba41f4658404e03491f4ebd6527b to your computer and use it in GitHub Desktop.
Save tvarohohlavy/85e9ba41f4658404e03491f4ebd6527b to your computer and use it in GitHub Desktop.
DeskPi Super6C | Raspberry Pi CM4 | Setup Github Self-hosted Runner on all nodes over SSH
# Variables
USERNAME=
HOSTNAME_BASE=deskpi0
DOMAIN=
RUNNER_VERSION=2.317.0
RUNNER_FILE=actions-runner-linux-arm64-$RUNNER_VERSION.tar.gz
RUNNER_LABELS=deskpi
# GITHUB_REG_URL=https://github.com/ORGANIZATION
# or
# GITHUB_REG_URL=https://github.com/USER/REPOSITORY
GITHUB_REG_URL=
GITHUB_TOKEN=
# Execute on nodes
for ID in {1..6}
do
echo "=================== $HOSTNAME_BASE$ID.$DOMAIN ==================="
ssh -T $USERNAME@$HOSTNAME_BASE$ID.$DOMAIN << EOF
mkdir actions-runner && cd actions-runner
# Download the latest runner package
curl -o $RUNNER_FILE -L https://github.com/actions/runner/releases/download/v$RUNNER_VERSION/$RUNNER_FILE
# Extract and remove the installer
tar xzf ./$RUNNER_FILE && rm ./$RUNNER_FILE
# Create and configure the runner
./config.sh --url $GITHUB_REG_URL --token $GITHUB_TOKEN --labels $RUNNER_LABELS,$HOSTNAME_BASE$ID --unattended && sleep 5
# Install as a service
sudo ./svc.sh install && sleep 5
# Run service
sudo ./svc.sh start && sleep 5
# Check status
sudo ./svc.sh status
EOF
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment