Self-hosted GitLab Runner
Stand up a runner and build a multi-stage pipeline.
0 of 6 steps
What you will end up with
A registered self-hosted runner
A multi-stage pipeline
Cached, parallel jobs
Build steps
0/6Spin up a small VM, or use an existing server, with Docker installed. This machine is the worker you are hiring to actually run your pipeline jobs.
Install gitlab-runner, then run gitlab-runner register with your project’s URL and the registration token from Settings then CI/CD. Registering is signing the worker up for a badge that lets it in.
In .gitlab-ci.yml, list stages: [build, test, deploy] and tag each job with one of those names. Stages are three doors a marble rolls through, always in the same order.
Give two jobs the same stage name so GitLab runs them at the same time instead of one after another. Same door, two marbles rolling through together.
Add a cache block with a key and paths, pointing at something like node_modules, so the next run reuses it instead of redownloading everything.
Add tags: [my-runner] to sensitive jobs and register the runner with a matching tag. It is a VIP wristband that only certain jobs are allowed to wear.
Before you start