11## How to set up Github Action runner
221 . Clone this repo and copy out the files in this directory to one level above
3- ``` shell
4- mkdir github-runner
5-
6- cd github-runner
7-
8- git clone https://github.com/filecoin-project/curio.git
9- git clone https://github.com/filecoin-project/boost.git
10-
11- cp -r boost/.github/utils/* .
12- ```
3+ ``` shell
4+ mkdir github-runner
5+
6+ cd github-runner
7+
8+ git clone https://github.com/filecoin-project/curio.git
9+ git clone https://github.com/filecoin-project/boost.git
10+
11+ cp -r boost/.github/utils/* .
12+ ```
13132. Copy the Dockerfile
14-
15- ``` shell
16- copy boost/.github/image/Dockerfile .
17- ```
14+ ` ` ` shell
15+ copy boost/.github/image/Dockerfile .
16+ ` ` `
1817
19183. Create new image
20-
21- ``` shell
22- docker buildx build -t curio/github-runner:latest .
23- ```
19+ ` ` ` shell
20+ docker buildx build -t curio/github-runner:latest .
21+ ` ` `
2422
25234. Create systemd file. Please ensure to equal number files for Boost and Curio. If server can host 10 runner then 5 should be for Boost and 5 for Curio.
26-
27- ``` shell
28- for i in {1..5}; do cat github-actions-runner.service | sed " s/NUM/$i /g" > github-actions-runner$i .service; done
29- for i in {6..10}; do cat github-actions-runner.service | sed ' s/curio-/boost-/g' | sed " s/NUM/$i /g" > github-actions-runner$i .service; done
30- for i in {1..10}; do install -m 644 github-actions-runner$i .service /etc/systemd/system/ ; done
31- systemctl daemon-reload
32- ```
24+ ` ` ` shell
25+ for i in {1..5}; do cat github-actions-runner.service | sed " s/NUM/$i /g" > github-actions-runner$i .service; done
26+ for i in {6..10}; do cat github-actions-runner.service | sed ' s/curio-/boost-/g' | sed " s/NUM/$i /g" > github-actions-runner$i .service; done
27+ for i in {1..10}; do install -m 644 github-actions-runner$i .service /etc/systemd/system/ ; done
28+ systemctl daemon-reload
29+ ` ` `
33305. Add the token to ENV files
31+ ` ` ` shell
32+ vi boost-github-actions-runner.env
33+ ` ` `
34+ add the token
35+ ` ` ` text
36+ LABELS=docker
37+ ACCESS_TOKEN=< TOKEN> --- Replace with a PAT
38+ ` ` `
39+
34406. Copy the ENV files to /etc
35-
36- ``` shell
37- cp boost-github-actions-runner.env
38- cp curio-github-actions-runner.env
39- ```
41+ ` ` ` shell
42+ cp boost-github-actions-runner.env /etc/
43+ cp curio-github-actions-runner.env /etc/
44+ ` ` `
4045
41467. Start and Enable the services
42- ``` shell
43- for i in {1..10}; do systemctl start github-actions-runner$i .service; done
44- for i in {1..10}; do systemctl status github-actions-runner$i .service; done
45- for i in {1..10}; do systemctl enable github-actions-runner$i .service; done
46- ```
47+ ` ` ` shell
48+ for i in {1..10}; do systemctl start github-actions-runner$i .service; done
49+ for i in {1..10}; do systemctl status github-actions-runner$i .service; done
50+ for i in {1..10}; do systemctl enable github-actions-runner$i .service; done
51+ ` ` `
4752
48538. Verify that new runners are visible in the repo.
4954
5055# # Set up docker image creator
51561. Make the script executable
52- ``` shell
53- cd github-runner
54- chmod +x create-runner-image.sh
55- ```
57+ ` ` ` shell
58+ cd github-runner
59+ chmod +x create-runner-image.sh
60+ ` ` `
56612. Create a cron job to update the image every day
57- ``` shell
58- crontab -e
59- ```
60-
61- ``` shell
62- 0 0 * * * /root/github-runner/create-runner-image.sh
63- ```
62+ ` ` ` shell
63+ crontab -e
64+ ` ` `
65+ add the below line
66+ ` ` ` shell
67+ 0 0 * * * /root/github-runner/create-runner-image.sh
68+ ` ` `
6469
6570# # Github Token
6671Creating GitHub personal access token (PAT) for using by self-hosted runner make sure the following scopes are selected:
@@ -74,4 +79,4 @@ notifications
7479workflow
7580` ` `
7681
77- ## This setup is based in the https://github.com/myoung34/docker-github-actions-runner
82+ This setup is based on the https://github.com/myoung34/docker-github-actions-runner
0 commit comments