【インターンステラ】GitLab+SphinxでHTMLを閲覧する方法

前回のsphinxで作成したHTMLをGitLab上で閲覧できるようにするまでの過程
GitLabにプロジェクトを作る。
https://gitlab.com/dashboard/projectsのNew projectからProject nameを決め、Create projectする。
Pushするには
$ git config --global user.name "ユーザー名" $ git config --global user.email "メールアドレス" $ git clone https://gitlab.com/ユーザー名orチーム名/プロジェクト名.git $ touch README.md $ git add README.md $ git commit -m "add README" $ git push -u origin master
全てのファイルをPushするには
$ git add . $ git commit -m "first commit" $ git push -u origin master
HTMLで閲覧するには
.gitlab-ci.ymlを作成する。(GitLabから直接作成も可能)
$ vim .gitlab-ci.yml image: python:2.7 stages: - pages pages: stage: pages script: - pip install sphinx - pip install sphinxcontrib-blockdiag sphinxcontrib-nwdiag sphinx_rtd_theme - make html - mv build/html/ public/ artifacts: paths: - public only: - master (保存はescから:wq)
Push後、GitLabの[設定]の[Pages]に移動し、リンク付きURLをクリックで閲覧可能。
(URLはhttps://ユーザー名.gitlab.io/プロジェクト名)
終わり
次回はGitLab Runnerの構築について
タイトル
本文