Setting Up a Custom GitHub Actions Runner

30 minutes
  • 3 Learning Objectives

About this Hands-on Lab

You are setting up a new app’s CI/CD process. Due to compliance requirements, this team’s code needs to run on your organization’s infrastructure, not GitHub’s. You will be provided with an EC2 instance, which you will need to set up to work as a GitHub runner. You will then need to set up a workflow to run only on that runner. Finally, you will need to disconnect the runner from your repo for the end of the lab.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Set Up the Lab VM to Work as a Runner Connected to Your GitHub Repo
  1. Create a new GitHub repo. Under Settings, click on Actions, then Runners. Click Add Runner and select Linux as the operating system. GitHub will generate a set of scripts to configure and enable the runner agent. Note these scripts for the next step.

  2. SSH into the lab VM. Run the first set of commands to download and extract the installer. Then, run the configure commands. Leave the terminal session open with the trailing logs. Back in the GitHub console, you will see the runner show up.

Set Up a Workflow to Run on the Runner
  1. Create a /github/workflows/custom-runner.yaml file. Create a workflow with one job and one step. It can echo Hello cloud gurus. Set up the job to run on the self-hosted runner. Commit the changes.

  2. You can see the job’s execution status in the GitHub console. You can also go back to the terminal with your SSH session and see the log from the runner.

Remove the Runner from Your Repo

When the lab ends, the runner will be destroyed. However, you will need to go into your GitHub repo and manually delete the runner’s record from there. This can be done at any time. Remember if you want to run that workflow again, you will need to update the runs-on command.

Additional Resources

Objectives

  1. Set up the lab VM to work as a runner connected to your GitHub repo.
  2. Set up a workflow to run on the runner.
  3. Remove the runner from the repository.

Links and Resources:

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?