Skip to content
Snippets Groups Projects
Commit f95d1de0 authored by Julian Rother's avatar Julian Rother
Browse files

Deploy docs to Gitlab Pages with sphinx-multiversion

parent f547da4c
No related branches found
Tags v0.0.1.dev1
No related merge requests found
Pipeline #8484 passed
......@@ -42,8 +42,8 @@ build:apt:
build:docs:
extends: .build
script:
- pip3 install Sphinx sphinx-rtd-theme
- cd docs && make html
- pip3 install Sphinx sphinx-rtd-theme sphinx-multiversion
- sphinx-build docs docs/_build/html
artifacts:
paths:
- docs/_build/html/index.html
......@@ -176,3 +176,16 @@ publish:apt:
- 'curl --user "${APTLY_API_USER}:${APTLY_API_PW}" -X PUT -H "Content-Type: application/json" --data "{ }" "${APT_API_URL}/api/publish/uffd/bullseye"'
dependencies:
- build:apt
pages:
stage: deploy
script:
- pip3 install Sphinx sphinx-rtd-theme sphinx-multiversion
- sphinx-multiversion docs public
- printf '/ /master 302\n/python-ldapserver /python-ldapserver/master 302\n' > public/_redirects
- du -sch public
artifacts:
paths:
- public
rules:
- if: '$CI_COMMIT_TAG =~ /v[0-9]+[.][0-9]+[.][0-9]+.*/ || $CI_COMMIT_BRANCH == "master"'
{%- if current_version %}
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions">
<span class="rst-current-version" data-toggle="rst-current-version">
<span class="fa fa-book"> Other Versions</span>
v: {{ current_version.name }}
<span class="fa fa-caret-down"></span>
</span>
<div class="rst-other-versions">
{%- if versions.tags %}
<dl>
<dt>Tags</dt>
{%- for item in versions.tags %}
<dd><a href="{{ item.url }}">{{ item.name }}</a></dd>
{%- endfor %}
</dl>
{%- endif %}
{%- if versions.branches %}
<dl>
<dt>Branches</dt>
{%- for item in versions.branches %}
<dd><a href="{{ item.url }}">{{ item.name }}</a></dd>
{%- endfor %}
</dl>
{%- endif %}
</div>
</div>
{%- endif %}
# Configuration file for the Sphinx documentation builder.
#Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
......@@ -28,7 +28,7 @@ author = 'Julian Rother'
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.autosummary',
'sphinx.ext.intersphinx', 'sphinx.ext.coverage']
'sphinx.ext.intersphinx', 'sphinx.ext.coverage', 'sphinx_multiversion']
autodoc_inherit_docstrings = False
autodoc_member_order = 'bysource'
......@@ -37,6 +37,12 @@ intersphinx_mapping = {
'python': ('https://docs.python.org/3', None),
}
smv_tag_whitelist = r'^v[0-9]+\.[0-9]+\.[0-9]+$'
smv_branch_whitelist = r'^master$'
smv_remote_whitelist = r'^origin$'
#smv_released_pattern = r'^tags/v[0-9]+\.[0-9]+\.[0-9]+$'
smv_prefer_remote_refs = False
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment