Last active
July 4, 2023 06:31
-
-
Save higebu/b8bf07c1b99689341689ecb65d854c2f to your computer and use it in GitHub Desktop.
cloud-init config for GitHub-hosted runner on Ubuntu 20.04
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package_update: true | |
package_upgrade: true | |
groups: | |
- docker | |
- lxd | |
users: | |
- default | |
- name: runner | |
gecos: GitHub-hosted runner User | |
groups: docker, lxd | |
ssh_import_id: | |
- gh:higebu | |
sudo: ALL=(ALL) NOPASSWD:ALL | |
shell: /bin/bash | |
runcmd: | |
- mkdir -p /etc/apt/keyrings | |
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg | |
- echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null | |
- apt-get update | |
- apt-get install -y vim jq git make wget apt-transport-https ca-certificates curl software-properties-common docker-ce docker-ce-cli containerd.io docker-compose-plugin python3-pip python3-venv | |
- systemctl enable docker | |
- systemctl start docker | |
- mkdir -p /home/runner/actions-runner | |
- chown runner:runner /home/runner/actions-runner | |
- cd /home/runner/actions-runner | |
- curl -O -L https://raw.githubusercontent.com/actions/runner/main/scripts/create-latest-svc.sh | |
- chmod +x ./create-latest-svc.sh | |
- RUNNER_CFG_PAT=_PAT_ bash ./create-latest-svc.sh -s _GITHUB_ORG_ -u runner -l ubuntu-focal | |
- pip3 install pipx | |
- echo 'export PATH="$PATH:/home/runner/.local/bin"' >> /home/runner/.bashrc | |
- echo '/home/runner/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin' > /home/runner/actions-runner/runner/.path | |
- chown runner:runner /home/runner/actions-runner/runner/.path | |
power_state: | |
mode: reboot |
Author
higebu
commented
Aug 19, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment