If you want to use self-hosted GitHub Runners. Currently works only on MacOS with ARM processor.
You have a free time and you want to code a little you own project. So you only need:
- start Docker or OrbStack;
- run single
nginx-webhook-receiver
container for receive GitHub's webhooks; - each webhook starts a new
github-runner-ubuntu
container to execute your workflow that connects to GitHub; - each
github-runner-ubuntu
container will destroy after finish workflow job; - stop
nginx-webhook-receiver
container when you finish (viaCTRL+C
in terminal).
- Generate your personal access token.
- Set
GITHUB_TOKEN
environment varialbe with your access token value. - Set correct
ORGANIZATION
andREPO
values inenv
file. - Build runner image (based on
ubuntu:latest
)
cd runner
docker build -t github-runner-ubuntu .
- Build webhook receiver image (based on
nginx:latest
)
cd ../webhook-receiver
docker build -t nginx-webhook-receiver .
- Run web webhook receiver (default port is
10000
or pass your own port number as additional parameter)
cd ..
./run-webhook-receiver.sh
For run self-hosted GitHub runner just visit:
curl -v http://127.0.0.1:10000/cgi-bin/start-runner.sh
- Create webhook
- Setup port forwarding on your router to your macbook
- If you not in home (for example in cafe) you can skip steps 4-7 and only run (you must run this manually on each push to your repository)
docker run --rm -d -e GITHUB_TOKEN=$GITHUB_TOKEN -e ORGANIZATION=$ORGANIZATION -e REPO=$REPO github-runner-ubuntu:latest