Last active
July 16, 2024 23:16
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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