Gitlab add gitlab runner
Add runner
Admin area->Overview->Runner
# For Debian/Ubuntu/Mint
curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh | sudo bash
# For RHEL/CentOS/Fedora
curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.rpm.sh | sudo bash
https://docs.gitlab.com/runner/install/linux-repository.html
# For Debian/Ubuntu/Mint
sudo apt-get install gitlab-runner
# For RHEL/CentOS/Fedora
sudo yum install gitlab-runner
Register runner
https://docs.gitlab.com/runner/register/index.html
gitlab-runner register --locked=false
--locked=false
the runner is locked by default
Docker image
should be alpine:latest
.gitlab-ci.yml
file must contain the same tags
with the runner’s tag to run pipline jobs
For example:
image: node:12.16.1
cache:
paths:
- node_modules/
before_script:
- npm install hexo-cli -g
- npm install hexo-generator-search -save
- npm install hexo-wordcount -save
- npm install hexo-generator-topindex --save
- test -e package.json && npm install
- hexo generate
pages:
script:
- hexo generate
artifacts:
paths:
- public
expire_in: 5 day
only:
- master
tags:
- main