64 lines
1.4 KiB
Markdown
64 lines
1.4 KiB
Markdown
# Forgejo runner
|
|
|
|
https://forgejo.org/docs/next/admin/actions/
|
|
|
|
## Prep
|
|
|
|
Make user: `forgejo-runner`
|
|
|
|
Make data directory within `/home/forgejo-runner`
|
|
|
|
```bash
|
|
set -e
|
|
|
|
mkdir -p data
|
|
touch data/.runner
|
|
mkdir -p data/.cache
|
|
|
|
chown -R 1001:1001 data/.runner
|
|
chown -R 1001:1001 data/.cache
|
|
chmod 775 data/.runner
|
|
chmod 775 data/.cache
|
|
chmod g+s data/.runner
|
|
chmod g+s data/.cache
|
|
```
|
|
|
|
|
|
## Config
|
|
|
|
### .runner
|
|
|
|
After registering the runner, use one of these images: https://github.com/catthehacker/docker_images/pkgs/container/ubuntu
|
|
|
|
eg, in .runner:
|
|
|
|
```json
|
|
{
|
|
|
|
"id": 1,
|
|
"uuid": "d772eb34-e677-4cfe-81a2-f0adcf038375",
|
|
"name": "jonny-runner",
|
|
"token": "...",
|
|
"address": "https://git.jon-e.net",
|
|
"labels": [
|
|
"docker:docker://node:16-bullseye",
|
|
"ubuntu-latest:docker://ghcr.io/catthehacker/ubuntu:act-latest"
|
|
]
|
|
}
|
|
```
|
|
|
|
### config.yaml
|
|
|
|
Use the one in this repo lol, symlink it into `/home/forgejo-runner`
|
|
|
|
|
|
## Getting pages working
|
|
|
|
- Make an nginx static directory site as one usually does, say from some directory `/var/www/pages`
|
|
|
|
- Map that directory into the top-level docker-compose image
|
|
- Edit `config.yaml` to allow for volume mappings
|
|
- Add the volume mapping to the default docker container arguments (see `config.yaml`)
|
|
- Blammo run a page build like normal and copy your result into that mapped directory.
|
|
|
|
See https://git.jon-e.net/jonny/test-pages/ for an example
|