@@ -222,56 +222,44 @@ need for constantly changing the patch.
222222## Configuring the builder.
223223
224224### Install prerequisites.
225-
226225```
227226sudo dnf install podman
228227```
229228
230- ### Add actions-runner service.
229+ ### Create a config file, needs github personal access token.
230+ Access token needs permissions; Repo Admin RW, Org Self-hosted runners RW.
231+ For details, consult
232+ https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-a-registration-token-for-a-repository
231233
234+ #### Create file /etc/actions-runner:
232235```
233- sudo cp self-hosted-builder/actions-runner.service /etc/systemd/system/
234- sudo systemctl daemon-reload
236+ REPO=<owner>/<name>
237+ PAT_TOKEN=<github_pat_***>
235238```
236239
237- ### Create a config file, needs github personal access token.
238-
240+ #### Set permissions on /etc/actions-runner:
239241```
240- # Create file /etc/actions-runner
241- repo=<owner>/<name>
242- access_token=<ghp_***>
242+ chmod 600 /etc/actions-runner
243243```
244244
245- Access token should have the repo scope, consult
246- https://docs.github.com/en/rest/reference/actions#create-a-registration-token-for-a-repository
247- for details.
245+ ### Add actions-runner service.
246+ ```
247+ sudo cp self-hosted-builder/actions-runner.service /etc/systemd/system/
248+ sudo systemctl daemon-reload
249+ ```
248250
249251### Autostart actions-runner.
250-
251252```
252253$ sudo systemctl enable --now actions-runner
253254```
254255
255- ## Rebuilding the container
256-
257- In order to update the ` gaplib- actions-runner` podman container, e.g. to get the
258- latest OS security fixes, follow these steps:
256+ ### Add auto-rebuild cronjob
257+ ```
258+ sudo cp self-hosted-builder/ actions-runner-rebuild.sh /etc/cron.weekly/
259+ chmod +x /etc/cron.weekly/actions-runner-rebuild.sh
259260```
260- # Stop actions-runner service
261- sudo systemctl stop actions-runner
262-
263- # Delete old container
264- sudo podman container rm gaplib-actions-runner
265-
266- # Delete old image
267- sudo podman image rm localhost/zlib-ng/actions-runner
268-
269- # Build image
270- sudo podman build --squash -f Dockerfile.zlib-ng --tag zlib-ng/actions-runner --build-arg .
271-
272- # Build container
273- sudo podman create --name=gaplib-actions-runner --env-file=/etc/actions-runner --init --interactive --volume=actions-runner-temp:/home/actions-runner zlib-ng/actions-runner
274261
275- # Start actions-runner service
276- sudo systemctl start actions-runner
262+ ## Building / Rebuilding the container
263+ ```
264+ sudo /etc/cron.weekly/actions-runner-rebuild.sh
277265```
0 commit comments