GitLab Pages
Table of Contents
設定
Pagesの有効化
$ sudo vi /etc/gitlab/gitlab.rb
##! Define to enable GitLab Pages # pages_external_url "http://pages.example.com/" # gitlab_pages['enable'] = false
##! Define to enable GitLab Pages pages_external_url "http://サーバ名:10080/" gitlab_pages['enable'] = true
$ sudo gitlab-ctl reconfigure
custom_nginx_config により公開する
- GitLab Pages without DNS wildcard (#29963) ・ Issues ・ GitLab.org / GitLab Community Edition ・ GitLab
nginx['custom_nginx_config'] = "include /etc/gitlab/nginx/conf.d/*.conf;
$ sudo vi /etc/gitlab/nginx/conf.d/pages.conf
server {
listen *:20080;
location / {
root /var/opt/gitlab/gitlab-rails/shared/pages/;
}
}
下記で ポート10080に設定しているのと同様、20080 も開ける必要があり
html
.gitlab-ci.yml
pages:
stage: deploy
script:
- mkdir .public
- cp -r * .public
- mv .public public
artifacts:
paths:
- public
only:
- master
mkdocs
参考
.gitlab-ci.yml
pages:
stage: deploy
script:
- mkdocs build -d public
artifacts:
paths:
- public
only:
- master
mkdocs.yml の例
site_name: プログラミング入門 site_description: 小学生とそのお母さんのためのプログラミング入門です。 site_author: '@wurly' copyright: copyright 2019 google_analytics: null theme: readthedocs site_dir: mkdocs_build pages: - Home: index.md - About: about.md - Categories: categories.md - Q&A: qa.md