- Lab
- A Cloud Guru
Setting Up a Custom GitHub Actions Runner
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.
Path Info
Table of Contents
-
Challenge
Set Up the Lab VM to Work as a Runner Connected to Your GitHub Repo
-
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.
-
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.
-
-
Challenge
Set Up a Workflow to Run on the Runner
-
Create a
/github/workflows/action.yaml
file. Create a workflow with one job and one step. It can echoHello cloud gurus
. Set up the job to run on the self-hosted runner. Commit the changes. -
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.
-
-
Challenge
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.
What's a lab?
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.
Provided environment for hands-on practice
We will provide the credentials and environment necessary for you to practice right within your browser.
Guided walkthrough
Follow along with the author’s guided walkthrough and build something new in your provided environment!
Did you know?
On average, you retain 75% more of your learning if you get time for practice.