This guide explains how to set up a self-hosted GitHub Actions runner that persists without requiring sudo privileges, specifically for the HPC deployment workflow.
- SSH access to a machine that can reach both GitHub.com and your HPC cluster
- Proper SSH key setup for connecting to the HPC
tmuxorscreeninstalled (for running the runner persistently)
-
In your GitHub repository, go to Settings > Actions > Runners > New self-hosted runner
-
Follow the instructions to download and configure the runner:
# Create a directory
mkdir -p ~/actions-runner && cd ~/actions-runner
# Download the runner package
curl -o actions-runner-linux-x64-2.303.0.tar.gz -L https://github.com/actions/runner/releases/download/v2.303.0/actions-runner-linux-x64-2.303.0.tar.gz
# Extract the installer
tar xzf ./actions-runner-linux-x64-2.303.0.tar.gz
# Configure the runner
./config.sh --url https://github.com/YOUR_USERNAME/YOUR_REPO --token YOUR_TOKENSince we can't use systemd without sudo rights, we'll use tmux to keep the runner running:
# Install tmux if not already available (you may need to use a package manager available to you)
# If you can't install it, check if it's already available:
which tmux
# Create a new tmux session
tmux new -s github-runner
# Inside the tmux session, start the runner
cd ~/actions-runner
./run.sh
# Detach from the tmux session with:
# Press Ctrl+B, then press DTo reattach to the session later:
tmux attach -t github-runnerEnsure your SSH configuration is correctly set up:
# Check if your SSH key exists
ls -la ~/.ssh/id_ed25519
# If you need to generate a key:
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519
# Test connection to the jump host
ssh bmicluster "hostname && whoami"
# Test connection to the compute node
ssh bmicluster-compute "hostname && whoami"- Push a small change to your repository or manually trigger a workflow
- Go to the Actions tab in your repository to see if the runner picks up the job
- Check the job logs for any errors
If the machine reboots, you'll need to restart the runner:
# Reattach to existing session (it might be gone after reboot)
tmux attach -t github-runner
# If the session doesn't exist, create a new one
tmux new -s github-runner
# Start the runner
cd ~/actions-runner
./run.shTo update the runner software:
# Stop any running runner by pressing Ctrl+C in the tmux session
# Then run:
cd ~/actions-runner
./config.sh --url https://github.com/YOUR_USERNAME/YOUR_REPO --token YOUR_TOKENIf the runner can't connect to GitHub:
- Check internet connectivity
- Verify firewall settings allow outbound HTTPS connections
- Check GitHub status page
If jobs fail with SSH connection errors:
- Verify SSH keys are set up correctly
- Check if SSH config has the correct hostnames and usernames
- Try connecting manually to verify credentials work