We recommend you follow this tutorial using a
Cost-Optimized Instance.Hosting your own runner on an Instance
- -runner
Actions stands as a versatile tool, simplifying the automation of all your software workflows. This integrated CI/CD solution handles an extensive array of tasks tied to your repository.
offers a limited range of complementary resources for constructing applications through Actions; however, proficient developers can swiftly encounter these constraints. Teams engaged in professional-grade projects might also want full authority over their build environment. extends the option to use runners on self-managed instances. A runner function is an application executing tasks from a Actions workflow.
In this guide, you will learn how to configure a Actions runner on a Scaleway Instance, effectively streamlining your project workflows. For typical workloads, opting for a
Cost-Optimized Instance is recommended. For resource-intensive workloads, the use of Production-Optimized Instances provides dedicated resources for enhanced performance.Before you startLink to this anchor
To complete the actions presented below, you must have:
- A Scaleway account logged into theconsole
- Owner status orIAM permissions allowing you to perform actions in the intended Organization
- AnSSH key
- AnInstance running on Ubuntu 20.04
- Aaccount
sudo
privileges or access to the root user
Adding a workflow to your repositoryLink to this anchor
- Log into youraccount and select the repository in which you want to add Actions.
- Click the Actions tab in your repository. A list of available workflows for your project displays.
- Select the workflow that corresponds to your project and click Set up this workflow. You can either create a workflow from scratch or use one of the templates suggested.
- Edit the workflow according to your requirements. For more information about Actions, refer to theproduct documentation. Once configured, save the workflow.
Installing a runnerLink to this anchor
- Connect to your Instance via SSH.
- Create a user for the runner.adduser ghrunner
- Add the user to the superuser file:adduser ghrunner sudo
- Switch into the
ghrunner
user account:su ghrunner - Download and unpack the runner using the following commands:# Create a foldermkdir actions-runner && cd actions-runner# Download the latest runner packagecurl -O -L https://.com/actions/runner/releases/download/v2.315.0/actions-runner-linux-x64-2.323.0.tar.gz# Extract the installertar xzf ./actions-runner-linux-x64-2.323.0.tar.gzTip
You may check the runner repository for the
latest release of the runner.
Adding the runner to your repositoryLink to this anchor
Go back to your repository and click the Settings tab. Then click Actions in the side menu.
Click Runners in the Actions section of the side menu. The external runners’ overview page displays.
Click Add runner.
The runners’ configuration instruction displays. Select the OS type of your OS (Linux, X64) and scroll down to the Configure section of the page.
Copy the configuration information displayed and execute the
config.sh
on your Instance:./config.sh --url https://.com/scaleway-community/my-project --token AC6XRSJUUEWXLYJ7SQ6WMVLASKYWZNoteIf you run the
config.sh
script without flags, you must provide the repository URL and token during the configuration.The configuration tool connects to using the given token.
Enter the name of the runner during the runner configuration. Several tags are automatically attached to it. Optionally, you can enter custom tags. When prompted, enter the
work
directory of the runner. You can confirm the default values by pressing enter. Otherwise, enter your customized values before pressing enter.The runner is configured. Once everything is ready, the following message displays:
√ Runner successfully added√ Runner connection is good[...]√ Settings Saved.Launch the runner using the following command:
./run.sh
Your self-hosted runner is now ready and you can check its status from the Runners section of your repository:
To run your CI/CD tasks on your self-hosted runner, add this YAML in your workflow file for each job:
runs-on: self-hosted
For more information about runners, refer to the
official documentation.