top of page
Search

Optimizing GitHub actions cache and Workflows with Self Hosted Runners

Illustration of GitHub Actions runners connected to a bare metal server rack, highlighting workflow automation and performance, with branding from BuildServers.xyz

For modern development teams, automation is essential — and GitHub Actions has become a go to CI/CD solution. But as projects grow, so do the limitations of shared GitHub hosted runners. If your workflows are starting to feel the strain, it’s time to look into self hosted runners — especially when powered by bare metal infrastructure.


What Are GitHub Actions Workflows?

A GitHub Actions workflow is a YAML defined automation pipeline that triggers on code pushes, pull requests, cron jobs, or manual input. These workflows can automate everything from:

  • Running unit and integration tests

  • Building Docker containers

  • Deploying to staging or production

  • Generating documentation or changelogs

  • Managing infrastructure with Terraform or Ansible

  • Restoring dependencies from a GitHub Actions cache

Each step in the workflow is executed by a runner — a server responsible for performing the job.


The Problem with Shared Runners

While GitHub’s hosted runners are free and easy to use, they come with tradeoffs:

  • Limited concurrency (especially on free plans)

  • Long queue times during peak hours

  • No persistent GitHub Actions cache between jobs

  • Lack of control over environment configuration

  • Slower performance due to shared hardware

For fast moving teams or large projects, these limitations can slow down development and increase costs.


Why Self Hosted Runners Make a Difference with Github Actions cache

Self hosted runners allow you to run GitHub Actions workflows on your own infrastructure — including on bare metal servers from BuildServers.xyz. This gives you:


1. Full Control

Install exactly what your builds need: specific SDKs, Docker in Docker, GPU support, or proprietary tools. You can also configure how the GitHub Actions cache is stored and reused between builds, improving efficiency.


2. Better Performance

Bare metal servers offer superior IO, CPU, and memory performance compared to virtualized cloud runners.


3. Consistent Build Times

Say goodbye to cold starts and environment changes. Your builds run in a known, stable environment — with the ability to use persistent GitHub Actions caches for dependencies, builds, and assets.


4. Lower Cost at Scale

If you're running CI dozens of times a day, a fixed cost server can be more economical than pay per minute pricing.


5. Privacy and Compliance

Keep sensitive code, secrets, or customer data out of shared environments — critical for regulated industries.


Setting Up Self Hosted Runners for GitHub Actions

Here’s a quick overview of the setup process:

  1. Provision a Server: Order a bare metal CI server from a provider like Hetzner or OVH

  2. Install GitHub Runner: Download the GitHub Actions runner binary and connect it to your repo or organization with a token.

  3. Run It as a Service: Use systemd or Docker to run the runner persistently.

  4. Tag Your Runners: Use labels (e.g., self hosted, docker, gpu) so specific workflows can target specific runners.

  5. Monitor and Scale: Add multiple runners per repo or organization depending on your team’s concurrency needs.


Example Workflow Using Self Hosted Runners

name: Build and Test
on: [push, pull_request]
jobs:
  build:
    runs-on: [self hosted, linux, docker]
    steps:
      - uses: actions/checkout@v3
      - name: Set up Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '20'
      - name: Restore GitHub Actions cache
        uses: actions/cache@v3
        with:
          path: ~/.npm
          key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
          restore-keys: |
            ${{ runner.os }}-node-
      - name: Install dependencies
        run: npm install
      - name: Run tests
        run: npm test

This example makes full use of the GitHub Actions cache to accelerate builds by avoiding redundant dependency installation.


BuildServers.xyz offers bare metal servers built for CI CD, including:

  • Pre hardened OS images

  • OS patching and management

  • Low latency servers across the EU

  • One month commitment only

  • Fast provisioning

We also offer shared CI CD runners for GitLab, GitHub, and Azure DevOps, great for teams just starting out.


Final Thoughts

Self hosted runners unlock a new level of performance, customization, and efficiency for GitHub Actions workflows. Combined with the raw power of bare metal and smart use of the GitHub Actions cache, they provide a serious competitive advantage for software teams looking to speed up delivery and regain control of their CI CD pipelines.

Explore your options today at BuildServers.xyz and experience what a true build server should feel like.


Buildserver - EU - Github Selfhosted Runner
Buy Now

 
 
 
bottom of page