Skip to content

Deploy GitHub Actions Self-Hosted Runner on Google Axion C4A VM #2149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
title: Deploy GitHub Actions Self-Hosted Runner on Google Axion C4A virtual machine

minutes_to_complete: 30

who_is_this_for: This Learning Path is for DevOps engineers, system administrators, or developers who want to deploy GitHub Actions Self-Hosted Runner on the Google Axion C4A Arm virtual machine.

learning_objectives:
- Provision an Arm virtual machine on the Google Cloud Platform using the C4A Google Axion instance family.
- Set up and validate a GitHub Actions self-hosted runner on the Arm virtual machine.
- Deploy a basic CI workflow with NGINX and verify execution on Arm infrastructure.

prerequisites:
- A [Google Cloud Platform (GCP)](https://cloud.google.com/free?utm_source=google&hl=en) account with billing enabled.
- Familiarity with [GitHub Actions](https://github.com/features/actions) and the Linux command line.
- A GitHub account. You can sign up [here](https://github.com/signup).

author: Jason Andrews

##### Tags
skilllevels: Advanced
subjects: CI-CD
cloud_service_providers: Google Cloud

armips:
- Neoverse

tools_software_languages:
- GitHub Actions
- GitHub CLI

operatingsystems:
- Linux

# ================================================================================
# FIXED, DO NOT MODIFY
# ================================================================================
further_reading:
- resource:
title: Google Cloud official website and documentation
link: https://cloud.google.com/docs
type: documentation

- resource:
title: Github-action official website and documentation
link: https://docs.github.com/en/actions
type: documentation

- resource:
title: GitHub Actions Arm runners
link: https://github.blog/news-insights/product-news/arm64-on-github-actions-powering-faster-more-efficient-build-systems/
type: website


weight: 1 # _index.md always has weight of 1 to order correctly
layout: "learningpathall" # All files under learning paths have this same wrapper
learning_path_main_page: "yes" # Indicates this should be surfaced when looking for related content. Only set for _index.md of learning path content.
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
# ================================================================================
# FIXED, DO NOT MODIFY THIS FILE
# ================================================================================
weight: 21 # Set to always be larger than the content in this path to be at the end of the navigation.
title: "Next Steps" # Always the same, html page title.
layout: "learningpathall" # All files under learning paths have this same wrapper for Hugo processing.
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
title: "About Google Axion C4A series and GitHub Actions"

weight: 2

layout: "learningpathall"
---

## Google Axion C4A series

The Google Axion C4A series is a family of Arm-based virtual machines built on Google’s custom Axion CPU, which is based on Arm Neoverse-V2 cores. Designed for high-performance and energy-efficient computing, these virtual machines offer strong performance ideal for modern cloud workloads such as CI/CD pipelines, microservices, media processing, and general-purpose applications.

The C4A series provides a cost-effective alternative to x86 virtual machine while leveraging the scalability and performance benefits of the Arm architecture in Google Cloud.

To learn more about Google Axion, refer to the blog [Introducing Google Axion Processors, our new Arm-based CPUs](https://cloud.google.com/blog/products/compute/introducing-googles-new-arm-based-cpu).

## GitHub Actions and CI/CD

GitHub Actions is a powerful CI/CD (Continuous Integration and Continuous Delivery) platform built into GitHub. It allows developers to automate tasks such as building, testing, and deploying code in response to events like code pushes, pull requests, or scheduled jobs—directly from their GitHub repositories. This helps improve development speed, reliability, and collaboration.

A key feature of GitHub Actions is [self-hosted runners](https://docs.github.com/en/actions/concepts/runners/about-self-hosted-runners), which let you run workflows on your own infrastructure instead of GitHub’s hosted servers. This is especially useful for:

- Running on custom hardware, including Arm64-based systems (e.g., Google Axion virtual machine), to optimize performance and ensure architecture-specific compatibility.
- Private network access, allowing secure interaction with internal services or databases.
- Faster execution, especially for resource-intensive workflows, by using dedicated or high-performance machines.

Self-hosted runners provide more control, flexibility, and cost-efficiency—making them ideal for advanced CI/CD pipelines and platform-specific testing.
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
---
title: Install and Set Up GitHub Self-Hosted Runner on Google Cloud C4A Virtual Machine
weight: 4

### FIXED, DO NOT MODIFY
layout: learningpathall
---


## Set Up GitHub Actions Self-Hosted Runner on Google Axion C4A Virtual Machine

This Learning Path shows how to deploy a self-hosted GitHub Actions runner on a Google Cloud C4A Arm64 virtual machine running Ubuntu. It covers installing Git and GitHub CLI, authenticating with GitHub and configuring the runner on an Arm64 environment for optimized CI/CD workflows.

### Install Git and GitHub CLI
```console
sudo apt update
sudo apt install -y git gh
```
Login to GitHub
```console
gh auth login
```
The command `gh auth login` is used to authenticate the GitHub CLI with your GitHub account. It allows you to securely log in using a web browser or token, enabling the CLI to interact with repositories, actions, and other GitHub features on your behalf.

![Login to GitHub](./images/gh-auth.png)

Below is the GitHub login UI:

![GitHub UI](./images/login-page.png)

### Test GitHub CLI and Git
Create a test repo:
```console
gh repo create test-repo –public
```
You should see an output similar to:
```output
✓ Created repository <your-github-account>/test-repo on GitHub
https://github.com/<your-github-account>/test-repo
```

The command `gh repo create test-repo --public` creates a new public GitHub repository named **test-repo** using the GitHub CLI. It sets the repository visibility to public, meaning anyone can view it

### Configure the Self-Hosted Runner
Go to your repository's **Settings > Actions**, and under the **Runners** section, click on **Add Runner** or view existing self-hosted runners.
If the **Actions** tab is not visible, ensure Actions are enabled by navigating to **Settings > Actions > General**, and select **Allow all actions and reusable workflows**.

![runner](./images/newsh-runner.png)

Then, click on the **New runner** button, followed by **New self-hosted runner**. In the **Add new self-hosted runner** section, proceed as follows:
- Select Linux for the operating system.
- Choose ARM64 for the architecture

![new-runner](./images/new-runner.png)

Next, execute the following instructions on your Google Axion C4A virtual machine:
```console
mkdir actions-runner && cd actions-runner# Download the latest runner package
curl -o actions-runner-linux-arm64-2.326.0.tar.gz -L https://github.com/actions/runner/releases/download/v2.326.0/actions-runner-linux-arm64-2.326.0.tar.gz
echo "ee7c229c979c5152e9f12be16ee9e83ff74c9d9b95c3c1aeb2e9b6d07157ec85 actions-runner-linux-arm64-2.326.0.tar.gz" | shasum -a 256 -c# Extract the installer
tar xzf ./actions-runner-linux-arm64-2.326.0.tar.gz
```
Then, configure the virtual machine with the following command:

```console
./config.sh --url https://github.com/<YOUR_USERNAME>/YOUR_REPO --token YOUR_TOKEN
```
Replace `YOUR_USERNAME`, `YOUR_REPO`, and `YOUR_TOKEN` accordingly.
This command links the runner to your GitHub repo using a one-time registration token.

During the command’s execution, you will be prompted to provide the runner group, the name of the runner, and the work folder name. You can accept the defaults by pressing **Enter** at each step. The output will resemble as below:

You should see an output similar to:

```output
--------------------------------------------------------------------------------
| ____ _ _ _ _ _ _ _ _ |
| / ___(_) |_| | | |_ _| |__ / \ ___| |_(_) ___ _ __ ___ |
| | | _| | __| |_| | | | | '_ \ / _ \ / __| __| |/ _ \| '_ \/ __| |
| | |_| | | |_| _ | |_| | |_) | / ___ \ (__| |_| | (_) | | | \__ \ |
| \____|_|\__|_| |_|\__,_|_.__/ /_/ \_\___|\__|_|\___/|_| |_|___/ |
| |
| Self-hosted runner registration |
| |
--------------------------------------------------------------------------------

# Authentication

√ Connected to GitHub
# Runner Registration
Enter the name of the runner group to add this runner to: [press Enter for Default]
Enter the name of runner: [press Enter for lpprojectubuntuarm64]
This runner will have the following labels: 'self-hosted', 'Linux', 'ARM64'
Enter any additional labels (ex. label-1,label-2): [press Enter to skip]
√ Runner successfully added
√ Runner connection is good
```

Finally, start the runner by executing:
```console
./run.sh
```
You should see an output similar to:

```output
√ Connected to GitHub

Current runner version: '2.326.0'
2025-07-15 05:51:13Z: Listening for Jobs
```
The runner will now be visible in the GitHub actions:

![final-runner](./images/final-runner.png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: Create Google Axion C4A Arm virtual machine
weight: 3

### FIXED, DO NOT MODIFY
layout: learningpathall
---

## Introduction

This guide walks you through provisioning **Google Axion C4A Arm virtual machine** on GCP with the **c4a-standard-4 (4 vCPUs, 16 GB Memory)** machine type, using the **Google Cloud Console**.

If you are new to Google Cloud, it is recommended to follow the [GCP Quickstart Guide to Create a virtual machine](https://cloud.google.com/compute/docs/instances/create-start-instance).

For more details, kindly follow the Learning Path on [Getting Started with Google Cloud Platform](https://learn.arm.com/learning-paths/servers-and-cloud-computing/csp/google/).

### Create an Arm-based Virtual Machine (C4A)

To create a virtual machine based on the C4A Arm architecture:
1. Navigate to the [Google Cloud Console](https://console.cloud.google.com/).
2. Go to **Compute Engine > VM Instances** and click on **Create Instance**.
3. Under the **Machine Configuration**:
- Fill in basic details like **Instance Name**, **Region**, and **Zone**.
- Choose the **Series** as `C4A`.
- Select a machine type such as `c4a-standard-4`.
![Instance Screenshot](./images/image.png)
4. Under the **OS and Storage**, click on **Change**, and select Arm64 based OS Image of your choice. For this Learning Path, we pick **Ubuntu** as the Operating System with **Ubuntu 24.04 LTS Minimal** as the Version. Make sure you pick the version of image for Arm.
5. Under **Networking**, enable **Allow HTTP traffic** to test workloads like NGINX later.
6. Click on **Create**, and the instance will launch.
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
title: Deploy NGINX on Self-Hosted Runner Using GitHub Actions
weight: 5

### FIXED, DO NOT MODIFY
layout: learningpathall
---


## Deploy NGINX Using GitHub Actions
This workflow installs and starts the NGINX web server on a self-hosted runner whenever code is pushed to the main branch.

### Create the Workflow:

Create a workflow file at `.github/workflows/deploy-nginx.yaml` with the following content:

```yaml

name: Deploy NGINX

on:
push:
branches: [ main ]

jobs:
deploy:
runs-on: self-hosted
steps:
- name: Install NGINX
run: |
sudo apt update
sudo apt install -y nginx

- name: Start NGINX
run: sudo systemctl start nginx
```
### Commit and Push:

```console
git add .
git commit -m "Add NGINX deploy workflow"
git push origin main
```
### Access the NGINX Server
Once the workflow completes, open your browser and navigate to:
```
http://<your-public-IP>
```
You should see the NGINX welcome page confirming a successful deployment.

![nginx](./images/nginx.png)