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 curio /.github/utils/* .
12
+ ```
13
13
2. Copy the Dockerfile
14
14
15
- ``` shell
16
- copy boost /.github/image/Dockerfile .
17
- ```
15
+ ` ` ` shell
16
+ copy curio /.github/image/Dockerfile .
17
+ ` ` `
18
18
19
19
3. Create new image
20
20
21
- ``` shell
22
- docker buildx build -t curio/github-runner:latest .
23
- ```
21
+ ` ` ` shell
22
+ docker buildx build -t curio/github-runner:latest .
23
+ ` ` `
24
24
25
25
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
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
- ```
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
+ ` ` `
33
33
5. Add the token to ENV files
34
+
35
+ ` ` ` shell
36
+ vi boost-github-actions-runner.env
37
+ ` ` `
38
+ add the token
39
+ ` ` ` text
40
+ LABELS=docker
41
+ ACCESS_TOKEN=< TOKEN> --- Replace with a PAT
42
+ ` ` `
43
+
34
44
6. Copy the ENV files to /etc
35
45
36
- ``` shell
37
- cp boost-github-actions-runner.env
38
- cp curio-github-actions-runner.env
39
- ```
46
+ ` ` ` shell
47
+ cp boost-github-actions-runner.env /etc/
48
+ cp curio-github-actions-runner.env /etc/
49
+ ` ` `
40
50
41
51
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
- ```
52
+ ` ` ` shell
53
+ for i in {1..10}; do systemctl start github-actions-runner$i .service; done
54
+ for i in {1..10}; do systemctl status github-actions-runner$i .service; done
55
+ for i in {1..10}; do systemctl enable github-actions-runner$i .service; done
56
+ ` ` `
47
57
48
58
8. Verify that new runners are visible in the repo.
49
59
50
60
# # Set up docker image creator
51
61
1. Make the script executable
52
- ``` shell
53
- cd github-runner
54
- chmod +x create-runner-image.sh
55
- ```
62
+ ` ` ` shell
63
+ cd github-runner
64
+ chmod +x create-runner-image.sh
65
+ ` ` `
56
66
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
- ```
67
+ ` ` ` shell
68
+ crontab -e
69
+ ` ` `
70
+ add the below line
71
+ ` ` ` shell
72
+ 0 0 * * * /root/github-runner/create-runner-image.sh
73
+ ` ` `
64
74
65
75
# # Github Token
66
76
Creating GitHub personal access token (PAT) for using by self-hosted runner make sure the following scopes are selected:
@@ -74,4 +84,4 @@ notifications
74
84
workflow
75
85
` ` `
76
86
77
- ## This setup is based in the https://github.com/myoung34/docker-github-actions-runner
87
+ This setup is based on the https://github.com/myoung34/docker-github-actions-runner
0 commit comments