Running GitHub Actions
The following guide outlines how to use DevBox as a runtime for GitHub actions.
Pre-built recipe templates are available here.
Using a self-hosted runner
Launch a new workspace on DevZero
Visit your GitHub organization/repo settings page.
Go to Actions > Runners.
For organization-wide runners: https://github.com/organizations/ORGANIZATION/settings/actions/runners
For repository-wide runners: https://github.com/ORGANIZATION/REPO/settings/actions/runners
Click on "New runner" and select "New self-hosted runner".
Select "Linux" and set "x64" as architecture.
Follow the instructions from GitHub provided on the page, which are similar to:
Download
Configure
The $TOKEN_FROM_GITHUB will be in the UI when you create the new runner.
You may use the default settings or customize values as you'd like when going through the prompts
The token from GitHub wll expire in about an hour and is unique for your instance.
You can also get the registration token non-interactively by sending a http request using curl:
Install and Start
Verify that the runner was added to your repo/org and is either in "Idle" or "Online" state.
Tip: The runner name should be same as the DevBox hostname.
Run a GitHub Action on the self-hosted runner to verify that it passes successfully, set
runs-on: self-hosted
:
Video Walkthrough
Here's a five minute video to see the process from end to end.
Using Actions Runner Controller
The Actions Runner Controller setup is still in beta and some actions, like running Docker in tests, aren't yet supported.
You will need a Personal Access Token (PAT).
To create one:
Visit Profile > Developer Settings > Personal access tokens > Tokens (classic).
Click on "Generate new token", select "Generate new token (classic)".
In the "scopes" section, select
repo
and optionallyadmin:org
for organization runners.Copy your new Personal Access Token.
After you obtained the PAT:
Install GitHub Actions Runner Controller using helm.
Scale-set controller
Adjust the NAMESPACE
variable as needed.
Runner scale-set
Adjust the INSTALLATION_NAME
, NAMESPACE
, GITHUB_CONFIG_URL
, and GITHUB_PAT
variables as needed.
Visit your repository/org settings, select Actions > Runners. Your new runner-set should be listed under "Runner scale sets" with the status shown as "Online".
To verify the installation, run a sample action:
Last updated