Lab: Runner - Ubuntu Latest
Introduction
In this lab, you will create and execute a simple GitHub Actions workflow that runs on the ubuntu-latest
GitHub-hosted runner. This lab demonstrates how to display operating system information and print custom messages from within a workflow.
Estimated Duration: 15–20 minutes
Instructions
Step 1: Set up your repository
-
Navigate to your GitHub repository where you want to create the workflow.
- If you don’t have a repository yet, create a new one by clicking + > New repository.
Step 2: Create the workflow file
-
In your repository, click the Code tab (if not already there).
-
Navigate to the
.github
folder. If it doesn’t exist:- Click Add file > Create new file
- Name the new file:
.github/workflows/runner-ubuntu-latest.yml
-
Paste the following YAML content into the file:
name: Runner - Ubuntu Latest on: workflow_dispatch jobs: run: runs-on: ubuntu-latest steps: - run: echo "This is a message from ubuntu latest runner" - name: Display OS Information run: | uname -a lsb_release -a
-
Click Commit new file to save the workflow.
Step 3: Understand the workflow
- Workflow name:
Runner - Ubuntu Latest
- Trigger:
workflow_dispatch
– this means the workflow must be triggered manually via the GitHub UI. - Runner: Uses GitHub-hosted
ubuntu-latest
environment. -
Steps:
- The first step prints a custom message.
- The second step displays operating system information using
uname -a
andlsb_release -a
.
Step 4: Trigger the workflow manually
- Go to the Actions tab in your repository.
- Click on Runner - Ubuntu Latest from the workflow list.
- Click the Run workflow button and confirm by clicking the green Run workflow button in the dropdown.
Step 5: View the output
- Once the workflow is running, click on the latest workflow run listed.
- Click on the run job to expand it.
-
Review the logs for:
- The custom echo message.
- The OS and kernel details returned by
uname -a
andlsb_release -a
.
Summary
In this lab, you created a GitHub Actions workflow that runs on the ubuntu-latest
runner and prints system-level details. This is useful for understanding the environment your GitHub Actions run in and for debugging platform-specific behavior.