1
1
## How to set up Github Action runner
2
2
1 . 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
+ ```
13
13
2. Copy the Dockerfile
14
-
15
- ``` shell
16
- copy boost/.github/image/Dockerfile .
17
- ```
14
+ ` ` ` shell
15
+ copy boost/.github/image/Dockerfile .
16
+ ` ` `
18
17
19
18
3. 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
+ ` ` `
24
22
25
23
4. 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
+ ` ` `
33
30
5. 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
+
34
40
6. 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
+ ` ` `
40
45
41
46
7. 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
+ ` ` `
47
52
48
53
8. Verify that new runners are visible in the repo.
49
54
50
55
# # Set up docker image creator
51
56
1. 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
+ ` ` `
56
61
2. 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
+ ` ` `
64
69
65
70
# # Github Token
66
71
Creating GitHub personal access token (PAT) for using by self-hosted runner make sure the following scopes are selected:
@@ -74,4 +79,4 @@ notifications
74
79
workflow
75
80
` ` `
76
81
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