Skip to content

Commit 0139743

Browse files
authored
update github action docs (#2005)
1 parent 1baa382 commit 0139743

File tree

2 files changed

+53
-47
lines changed

2 files changed

+53
-47
lines changed

.github/utils/create-runner-image.sh

+1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@ setup_github_runner() {
3030
}
3131

3232
# Execute the function
33+
docker system prune -a -f
3334
setup_github_runner

.github/utils/setup.md

+52-47
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,71 @@
11
## How to set up Github Action runner
22
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+
```
1313
2. Copy the Dockerfile
14-
15-
```shell
16-
copy boost/.github/image/Dockerfile .
17-
```
14+
```shell
15+
copy boost/.github/image/Dockerfile .
16+
```
1817

1918
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+
```
2422

2523
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+
```
3330
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+
3440
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+
```
4045

4146
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+
```
4752

4853
8. Verify that new runners are visible in the repo.
4954

5055
## Set up docker image creator
5156
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+
```
5661
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+
```
6469

6570
## Github Token
6671
Creating GitHub personal access token (PAT) for using by self-hosted runner make sure the following scopes are selected:
@@ -74,4 +79,4 @@ notifications
7479
workflow
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

Comments
 (0)