<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>GitHub runner - Architect the cloud</title>
	<atom:link href="https://blog.slepcevic.net/category/github-runner/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.slepcevic.net</link>
	<description></description>
	<lastBuildDate>Wed, 23 Oct 2024 23:23:22 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>
	<item>
		<title>Get your own own Github runner deployed and configured on Linode in less than 5 minutes.</title>
		<link>https://blog.slepcevic.net/get-your-own-own-github-runner-deployed-and-configured-on-linode-in-less-than-5-minutes/</link>
					<comments>https://blog.slepcevic.net/get-your-own-own-github-runner-deployed-and-configured-on-linode-in-less-than-5-minutes/#respond</comments>
		
		<dc:creator><![CDATA[Alesandro Slepčević]]></dc:creator>
		<pubDate>Wed, 23 Oct 2024 23:19:20 +0000</pubDate>
				<category><![CDATA[Akamai Connected Cloud]]></category>
		<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[GitHub]]></category>
		<category><![CDATA[GitHub runner]]></category>
		<category><![CDATA[Linux]]></category>
		<guid isPermaLink="false">https://blog.slepcevic.net/?p=685</guid>

					<description><![CDATA[<p>Why would you run your own runner anyways? GitHub Actions (along with Azure DevOps) has emerged as a powerful managed tool that allows developers to automate workflows directly within their GitHub repositories. While GitHub provides hosted runners to execute these...</p>
<p>The post <a href="https://blog.slepcevic.net/get-your-own-own-github-runner-deployed-and-configured-on-linode-in-less-than-5-minutes/">Get your own own Github runner deployed and configured on Linode in less than 5 minutes.</a> first appeared on <a href="https://blog.slepcevic.net">Architect the cloud</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><strong>Why would you run your own runner anyways?</strong></p>



<p>GitHub Actions (along with Azure DevOps) has emerged as a powerful managed tool that allows developers to automate workflows directly within their GitHub repositories. While GitHub provides hosted runners to execute these workflows, running your own GitHub runner can offer several advantages. </p>



<p><strong>1. Money talks</strong></p>



<p>One of the primary benefits of running your own GitHub runner is cost efficiency. GitHub Actions provides a certain number of free minutes for public and private repositories, but once you exceed these limits, costs can add up quickly, especially if your execution takes a while <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f641.png" alt="🙁" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>



<p><strong>2</strong>. <strong>Customization and Control</strong></p>



<p>When you run your own GitHub runner, you gain full control over the environment in which your workflows execute. This means you can customize the runner&#8217;s operating system, software, and dependencies to match your project’s specific needs. It doesn&#8217;t matter anymore if you need a particular version of a programming language, specialized libraries, or specific system configurations, your self-hosted runner can be tailored to your requirements.</p>



<p><strong>3</strong>. <strong>Performance and Speed</strong></p>



<p>Self-hosted runners can significantly enhance the performance of your CI/CD pipelines. Since these runners are dedicated to your projects, you can optimize them for speed and efficiency. You can run builds on beefy machines, use faster storage, or even set up parallel execution across multiple runners to speed up your workflows. This is especially beneficial for larger projects or teams with multiple repositories or a bunch of members working in parallel. </p>



<p><strong>4. Security and Compliance</strong></p>



<p>For organizations handling sensitive data or operating in regulated industries, security is number one. Running your own GitHub runner allows you to maintain control over your CI/CD environment. You can implement your own security measures, restrict network access, and ensure that sensitive information does not leave your secured infrastructure. Additionally, you can regularly update and audit your runner to comply with internal policies or external regulations.</p>



<p><strong>5. Reduced Queue Times</strong></p>



<p>Using GitHub&#8217;s hosted runners means you may encounter queue times, especially during peak usage periods. By setting up your own runners, you can mitigate these delays, ensuring that your workflows kick off as soon as possible. </p>



<p><strong>How do I get it running? </strong></p>



<p><strong>Step 1</strong> &#8211; Clone the repository using the following command. </p>



<pre class="wp-block-code"><code>git clone https://github.com/slepix/GitHubRunner-Linode.git</code></pre>



<p></p>



<h5 class="wp-block-heading">You will need to prepare 5 things; it&#8217;s not hard, I promise. </h5>



<ol class="wp-block-list">
<li><strong>Linode API token</strong> with permission to deploy virtual machines &#8211; <a href="https://techdocs.akamai.com/cloud-computing/docs/manage-personal-access-tokens" target="_blank" rel="noopener" title="">more info</a></li>



<li><strong>GitHub PAT</strong> limited only to the repository you want to connect &#8211;<a href="https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens" target="_blank" rel="noopener" title=""> more details</a></li>



<li><strong>GitHub repository</strong> name you want to connect your runner to. </li>



<li><strong>GitHub username</strong> which owns the repository. </li>



<li><strong>Root password</strong> for the runner VM &#8211; can be anything, as long as it&#8217;s long and complex. </li>
</ol>



<p><strong>Step 2</strong> &#8211; Fill in the details in <strong>linoderunner.tfvars</strong> file; it should look something like this. </p>



<p>*These are random values, so make sure to replace them with your own. </p>



<pre class="wp-block-code"><code>linode_api_token = "eee44387b0030bd6bb051452bg65gz56z465fba5d77c5a238ea8e12f"
github_pat = "github_pat_1HG534e67d3K52IUSL_D2vM1pzjDGjX5sCiUEXWD6TRKDut4jnJty"
root_password = "Rand0mSecurePassword.123!" # Root password for your VM
github_repo = "myawesomeapp" # Your Github repo name
github_username = "slepix" # Your GitHub username</code></pre>



<p><strong>Step 3</strong> &#8211; run the following command:</p>



<pre class="wp-block-code"><code>terraform apply --var-file="linoderunner.tfvars"</code></pre>



<p>Entire codebase is available at <a href="https://github.com/slepix/GithubRunner-Linode" target="_blank" rel="noopener" title="">https://github.com/slepix/GithubRunner-Linode</a></p>



<p>Ok, let&#8217;s take a look at some code. Once again, we&#8217;ll go with Terraform and cloud-init to deploy and configure our server. Ideally you would use some configuration management tool like Puppet, Ansible, Chef or similar, but for this use case, we can keep it simple. </p>



<p>Using cloud-init, we create a new user called &#8220;<strong>gitrunner</strong>&#8221; which will be used to run the agent, update all the packes, install jq (needed by the agent configuration script) and kick off the installation of the runner as a service. </p>



<p><strong>compute.tf file</strong> &#8211; this is where you can adjust the region, OS and instance type you want to run. </p>



<pre class="wp-block-code"><code>resource "linode_instance" "github_runner" {
  image     = "linode/ubuntu22.04"
  region    = "nl-ams"
  type      = "g6-nanode-1"
  label     = "github-runner"
  root_pass = var.root_password  # Set the root password

  metadata {
    user_data = base64encode(templatefile("./linode.yaml.tpl", {
      githubpat = var.github_pat
      githubuser = var.github_username
      githubrepo = var.github_repo
    }))
  }
}</code></pre>



<p><strong>linode.yaml.tpl file</strong></p>



<pre class="wp-block-code"><code>#cloud-config
package_update: true
packages:
  - jq

users:
  - name: gitrunner
    shell: /bin/bash
    groups:
      - sudo
    sudo:
      - ALL=(ALL) NOPASSWD:ALL

runcmd:
  - export RUNNER_CFG_PAT=${githubpat}
  - su gitrunner -c "cd /home/gitrunner &amp;&amp; curl -s https://raw.githubusercontent.com/actions/runner/main/scripts/create-latest-svc.sh | bash -s ${githubuser}/${githubrepo}" 
</code></pre>



<p>If all went good, you should see the new GitHub runner appear in your runner overview in a few mins. </p>



<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="1024" height="316" src="https://blog.slepcevic.net/wp-content/uploads/2024/10/runner-1024x316.png" alt="" class="wp-image-686" srcset="https://blog.slepcevic.net/wp-content/uploads/2024/10/runner-1024x316.png 1024w, https://blog.slepcevic.net/wp-content/uploads/2024/10/runner-300x92.png 300w, https://blog.slepcevic.net/wp-content/uploads/2024/10/runner-768x237.png 768w, https://blog.slepcevic.net/wp-content/uploads/2024/10/runner.png 1152w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>Happy building and deploying!</p>



<p>Alex!</p><p>The post <a href="https://blog.slepcevic.net/get-your-own-own-github-runner-deployed-and-configured-on-linode-in-less-than-5-minutes/">Get your own own Github runner deployed and configured on Linode in less than 5 minutes.</a> first appeared on <a href="https://blog.slepcevic.net">Architect the cloud</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://blog.slepcevic.net/get-your-own-own-github-runner-deployed-and-configured-on-linode-in-less-than-5-minutes/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Lazy Loading (feed)

Served from: blog.slepcevic.net @ 2026-01-01 21:48:08 by W3 Total Cache
-->