forked from Wings-XI/github-runner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathephemeral-runner.service
26 lines (26 loc) · 1.14 KB
/
ephemeral-runner.service
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Install with:
# for i in `seq 1 5` ; do sudo install -m 644 ephemeral-runner.service /etc/systemd/system/ephemeral-runner-$i.service ; sudo systemctl daemon-reload ; sudo systemctl enable ephemeral-runner-$i ; sudo systemctl stop ephemeral-runner-$i ; sudo systemctl start ephemeral-runner-$i ; done
# Run with:
# sudo systemctl start ephemeral-runner*
# Stop with:
# sudo systemctl stop ephemeral-runner*
# See live logs with:
# journalctl -f -u ephemeral-runner-X --no-hostname --no-tail
[Unit]
Description=Ephemeral GitHub Actions Runner Container
#After=docker.service
#Requires=docker.service
[Service]
Type=simple
TimeoutStartSec=0
Restart=always
ExecStartPre=-/usr/bin/docker stop %N
ExecStartPre=-/usr/bin/docker rm %N
ExecStartPre=-/usr/bin/docker build --pull --tag github-runner-local -f /etc/ephemeral-runner.Dockerfile .
ExecStart=/usr/bin/docker run --rm \
--env-file /etc/ephemeral-github-actions-runner.env \
-v /var/run/docker.sock:/var/run/docker.sock \
--name %N \
github-runner-local
[Install]
WantedBy=multi-user.target