r
dart
+
->
sklearn
parcel
+
+
+
+
+
+
+
ts
dns
zig
+
+
git
dask
+
~
angular
+
+
jasmine
+=
aws
cypress
+
+
==
+
mongo
emacs
+
+
+
+
cdn
windows
nomad
fastapi
hapi
pycharm
+
+
yaml
htmx
+
webstorm
--
+
+
+
+
suse
sublime
d
+
abap
+
vault
dynamo
+
+
travis
+
yarn
+
ray
+
--
kali
+
numpy
chef
vscode
+
+
+
sinatra
+
+
+
+
intellij
+
+
+
Back to Blog
๐Ÿš€ Configuring GitHub Actions Runner: Simple Guide
Alpine Linux GitHub Actions CI/CD

๐Ÿš€ Configuring GitHub Actions Runner: Simple Guide

Published Jun 4, 2025

Easy tutorial for setting up GitHub Actions runner on Alpine Linux. Perfect for beginners with step-by-step instructions and clear examples.

9 min read
0 views
Table of Contents

๐Ÿš€ Configuring GitHub Actions Runner: Simple Guide

Letโ€™s set up a GitHub Actions runner on Alpine Linux! ๐Ÿ’ป This tutorial shows you how to create your own automation worker that runs tasks for your GitHub projects. Itโ€™s like having a helpful robot that does repetitive work for you! ๐Ÿ˜Š

๐Ÿค” What is a GitHub Actions Runner?

A GitHub Actions runner is like a dedicated worker for your code projects! ๐Ÿค– It automatically runs tests, builds applications, and deploys software whenever you make changes to your GitHub repository.

A GitHub Actions runner is like:

  • ๐Ÿญ A factory worker who builds products automatically
  • ๐Ÿ”„ A washing machine that runs cleaning cycles
  • ๐Ÿ“‹ An assistant who follows your instruction list perfectly

๐ŸŽฏ What You Need

Before we start, you need:

  • โœ… Alpine Linux system running
  • โœ… GitHub account with repository access
  • โœ… Root access to your system
  • โœ… Internet connection for downloading runner software

๐Ÿ“‹ Step 1: Prepare System

Installing Required Dependencies

Letโ€™s start by installing everything needed for the GitHub runner. Itโ€™s easy! ๐Ÿ˜Š

What weโ€™re doing: Installing tools and dependencies required by GitHub Actions runner.

# Update package index
apk update

# Install required packages
apk add curl bash git tar gzip

# Install Docker for containerized actions
apk add docker docker-compose

# Install Node.js for JavaScript actions
apk add nodejs npm

# Start Docker service
rc-service docker start
rc-update add docker default

# Create user for running actions
adduser -D -s /bin/bash github-runner

What this does: ๐Ÿ“– Your system now has all tools needed to run GitHub Actions.

Example output:

โœ… Dependencies installed successfully
โœ… Docker service started
โœ… GitHub runner user created

What this means: Your system is ready for GitHub Actions! โœ…

๐Ÿ’ก Important Tips

Tip: Always use a dedicated user for security! ๐Ÿ’ก

Warning: Keep your runner token secret and secure! โš ๏ธ

๐Ÿ› ๏ธ Step 2: Download and Configure Runner

Getting the GitHub Actions Runner

Now letโ€™s download and set up the GitHub Actions runner software! ๐Ÿ“ฆ

What weโ€™re doing: Downloading the runner and configuring it for your GitHub repository.

# Switch to github-runner user
su - github-runner

# Create directory for runner
mkdir -p /home/github-runner/actions-runner
cd /home/github-runner/actions-runner

# Download latest runner (check GitHub for current version)
curl -o actions-runner-linux-x64-2.311.0.tar.gz \
  -L https://github.com/actions/runner/releases/download/v2.311.0/actions-runner-linux-x64-2.311.0.tar.gz

# Verify download (optional)
echo "29fc8cf2dab4c195bb147384e7e2c94cfd4d4022c793b346a6175435265e8153  actions-runner-linux-x64-2.311.0.tar.gz" | sha256sum -c

# Extract runner files
tar xzf ./actions-runner-linux-x64-2.311.0.tar.gz

Code explanation:

  • curl -L: Downloads the runner package from GitHub
  • tar xzf: Extracts the compressed runner files
  • sha256sum -c: Verifies file integrity for security
  • /home/github-runner/actions-runner: Runner installation directory

Expected Output:

โœ… Runner downloaded successfully
โœ… File integrity verified
โœ… Runner files extracted

What this means: Great job! Runner software is ready for configuration! ๐ŸŽ‰

๐ŸŽฎ Letโ€™s Try It!

Time for hands-on practice! This is the fun part! ๐ŸŽฏ

What weโ€™re doing: Configuring the runner to connect to your GitHub repository.

# Configure the runner (you'll need a token from GitHub)
# Go to your repo โ†’ Settings โ†’ Actions โ†’ Runners โ†’ New self-hosted runner

# Run configuration script
./config.sh --url https://github.com/YOUR-USERNAME/YOUR-REPO --token YOUR-TOKEN

# When prompted, provide:
# - Runner name: alpine-runner-01
# - Runner group: Default
# - Labels: alpine,linux,self-hosted
# - Work folder: _work

# Test runner configuration
./run.sh --once

Configuration example:

Enter the name of the runner group: [press Enter for default]
Enter the name of runner: alpine-runner-01
Enter any additional labels: alpine,linux,docker
Enter name of work folder: _work

You should see:

โœ… Runner successfully configured
โœ… Connected to GitHub repository
โœ… Ready to process jobs

Awesome work! ๐ŸŒŸ

๐Ÿ“Š Quick Summary Table

What to DoCommandResult
๐Ÿ”ง Install depsapk add curl bash gitโœ… System prepared
๐Ÿ› ๏ธ Download runnercurl -o actions-runner...โœ… Runner software ready
๐ŸŽฏ Configure./config.sh --url ...โœ… Connected to GitHub

๐ŸŽฎ Practice Time!

Letโ€™s practice what you learned! Try these simple examples:

Example 1: Create Runner Service ๐ŸŸข

What weโ€™re doing: Setting up the runner to start automatically as a system service.

# Exit from github-runner user
exit

# Create systemd service file
cat > /etc/systemd/system/github-actions-runner.service << 'EOF'
[Unit]
Description=GitHub Actions Runner
After=network.target

[Service]
Type=simple
User=github-runner
WorkingDirectory=/home/github-runner/actions-runner
ExecStart=/home/github-runner/actions-runner/run.sh
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target
EOF

# Install OpenRC service instead (Alpine uses OpenRC)
cat > /etc/init.d/github-actions-runner << 'EOF'
#!/sbin/openrc-run

name="GitHub Actions Runner"
description="GitHub Actions self-hosted runner"

user="github-runner"
directory="/home/github-runner/actions-runner"
command="${directory}/run.sh"
pidfile="/var/run/${RC_SVCNAME}.pid"

depend() {
    need net
    after docker
}

start_pre() {
    checkpath --directory --owner ${user}:${user} --mode 0755 \
        /var/run/${RC_SVCNAME} /var/log/${RC_SVCNAME}
}
EOF

chmod +x /etc/init.d/github-actions-runner

# Start and enable service
rc-service github-actions-runner start
rc-update add github-actions-runner default

What this does: Makes the runner start automatically when system boots! ๐ŸŒŸ

Example 2: Create Test Workflow ๐ŸŸก

What weโ€™re doing: Creating a simple workflow to test your new runner.

# Create example workflow file (do this in your GitHub repo)
mkdir -p .github/workflows

cat > .github/workflows/test-alpine-runner.yml << 'EOF'
name: Test Alpine Runner

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  test-on-alpine:
    runs-on: self-hosted
    
    steps:
    - name: Checkout code
      uses: actions/checkout@v3
    
    - name: Show system info
      run: |
        echo "๐Ÿ”๏ธ Running on Alpine Linux!"
        uname -a
        cat /etc/alpine-release
        whoami
        pwd
    
    - name: Test Docker
      run: |
        docker --version
        docker run --rm hello-world
    
    - name: Test Node.js
      run: |
        node --version
        npm --version
        echo "console.log('Hello from Alpine runner!');" | node
    
    - name: Success message
      run: |
        echo "โœ… Alpine Linux runner working perfectly!"
        echo "๐ŸŽ‰ Your CI/CD pipeline is ready!"
EOF

echo "๐Ÿ“ Upload this workflow to your GitHub repository!"
echo "๐Ÿ“ Location: .github/workflows/test-alpine-runner.yml"

What this does: Tests all runner capabilities with a real workflow! ๐Ÿ“š

๐Ÿšจ Fix Common Problems

Problem 1: Runner fails to start โŒ

What happened: The runner service wonโ€™t start properly. How to fix it: Check logs and permissions!

# Check runner status
rc-service github-actions-runner status

# View runner logs
tail -f /var/log/github-actions-runner/current

# Check file permissions
ls -la /home/github-runner/actions-runner/

# Fix permissions if needed
chown -R github-runner:github-runner /home/github-runner/

Problem 2: Actions fail with permission errors โŒ

What happened: GitHub Actions canโ€™t access Docker or other services. How to fix it: Add user to necessary groups!

# Add github-runner to docker group
adduser github-runner docker

# Add to other necessary groups
adduser github-runner wheel

# Restart runner service
rc-service github-actions-runner restart

# Test Docker access
su - github-runner -c "docker ps"

Donโ€™t worry! These problems happen to everyone. Youโ€™re doing great! ๐Ÿ’ช

๐Ÿ’ก Simple Tips

  1. Monitor regularly ๐Ÿ“… - Check runner status and logs
  2. Keep updated ๐ŸŒฑ - Update runner software regularly
  3. Secure tokens ๐Ÿค - Rotate runner tokens periodically
  4. Scale wisely ๐Ÿ’ช - Add more runners when needed

โœ… Check Everything Works

Letโ€™s make sure everything is working:

# Check runner service status
rc-service github-actions-runner status

# Verify runner is connected to GitHub
su - github-runner -c "cd actions-runner && ./run.sh --once"

# Test Docker functionality
docker run --rm hello-world

# Check available disk space for builds
df -h /home/github-runner/

Good output:

โœ… Runner service is running
โœ… Connected to GitHub successfully  
โœ… Docker working properly
โœ… Sufficient disk space available

๐Ÿ† What You Learned

Great job! Now you can:

  • โœ… Install and configure GitHub Actions runner
  • โœ… Set up automatic service startup
  • โœ… Create and test CI/CD workflows
  • โœ… Troubleshoot common runner issues

๐ŸŽฏ Whatโ€™s Next?

Now you can try:

  • ๐Ÿ“š Learning about advanced workflow strategies
  • ๐Ÿ› ๏ธ Setting up multiple runners for parallel jobs
  • ๐Ÿค Helping others automate their development processes
  • ๐ŸŒŸ Building complex CI/CD pipelines with testing and deployment!

Remember: Every expert was once a beginner. Youโ€™re doing amazing! ๐ŸŽ‰

Keep automating and youโ€™ll save tons of time on repetitive tasks! ๐Ÿ’ซ