forked from Wings-XI/github-runner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathephemeral-github-actions-runner.service
32 lines (32 loc) · 1.27 KB
/
ephemeral-github-actions-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
27
28
29
30
31
32
# Install with:
# sudo install -m 644 ephemeral-github-actions-runner.service /etc/systemd/system/
# sudo systemctl daemon-reload
# sudo systemctl enable ephemeral-github-actions-runner
# Run with:
# sudo systemctl start ephemeral-github-actions-runner
# Stop with:
# sudo systemctl stop ephemeral-github-actions-runner
# See live logs with:
# journalctl -f -u ephemeral-github-actions-runner.service --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 pull myoung34/github-runner:ubuntu-jammy
# runs at the same time as ExecStart
ExecStartPost=-/usr/bin/sleep 3
ExecStartPost=-/usr/bin/docker exec %N apt-get install -y python3-dev npm screen clang-format-14
ExecStart=/usr/bin/docker run --rm \
--env-file /etc/ephemeral-github-actions-runner.env \
-e RUNNER_NAME=%H \
-v /var/run/docker.sock:/var/run/docker.sock \
--name %N \
myoung34/github-runner:ubuntu-jammy
[Install]
WantedBy=multi-user.target