diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index eddf40b01..7ffd2f2a4 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -48,7 +48,7 @@ generate-docs:
# CI_OUTPUT_DIR: doc_output
# EOS_ACCOUNT_PASSWORD: xxx
# EOS_ACCOUNT_USERNAME: xxx
-# EOS_PATH: /eos/project/k/key4hep/www/key4hep/podio
+# EOS_DEPLOY_BASE_PATH: /eos/project/k/key4hep/www/key4hep/podio
# METHOD: rsync
# are set in the repository https://gitlab.cern.ch/key4hep/podio,
# which mirrors https://github.com/AIDASoft/podio
@@ -62,13 +62,18 @@ deployment:
only:
refs:
- master
+ - versioned-docs
+ - /^v\d+-\d+-?\d+?$/
# need the doxygen artifacts for this step
dependencies:
- generate-docs
stage: deploy
+
# see see https://gitlab.cern.ch/ci-tools/ci-web-deployer
image: gitlab-registry.cern.ch/ci-tools/ci-web-deployer:latest
+ before_script:
+ - if [ -z "$CI_COMMIT_BRANCH" ]; then TARGET_DEPLOY_DIR=$CI_COMMIT_TAG; else TARGET_DEPLOY_DIR=$CI_COMMIT_BRANCH; fi
+ - export EOS_PATH=$EOS_DEPLOY_BASE_PATH/_contents/$TARGET_DEPLOY_DIR
script:
- deploy-eos
- before_script: []
after_script: []
diff --git a/doc/_templates/versions.html b/doc/_templates/versions.html
new file mode 100644
index 000000000..d03bcd181
--- /dev/null
+++ b/doc/_templates/versions.html
@@ -0,0 +1,79 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/doc/conf.py b/doc/conf.py
index afb0d83ec..188e70c6b 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -51,7 +51,7 @@
source_suffix = {".rst": "restructuredtext", ".md": "markdown"}
# Add any paths that contain templates here, relative to this directory.
-# templates_path = ["_templates"]
+templates_path = ["_templates"]
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
diff --git a/doc/web-deploy/README.md b/doc/web-deploy/README.md
new file mode 100644
index 000000000..e3a95bcc4
--- /dev/null
+++ b/doc/web-deploy/README.md
@@ -0,0 +1,28 @@
+# Versioned documentation deployment
+
+- Assumed to be deployed via eos using a folder structure like this
+```console
+.
+├── _contents
+│ ├── vXX-YY
+│ └── master
+├── index.html
+```
+ - Each version / tag gets a new folder and the `master` / develop version is
+ continually updated
+ - The `_contents` folder has to configured to have *Directory Browsing* enabled
+ since that will be used to determine the available versions (each top-level
+ folder in here will be considered a version). This is achieved via `echo
+ "Options +Indexes > _contents/.htaccess"`
+- The `version.html` "template" fetches the directory from `_contents`, extracts
+ the available directories (via their links) and creates a sorted list of
+ versions before dynamically populating the read-the-docs bit for version
+ selection
+- gitlab ci takes care of copying the generated contents to the correct
+ subfolder of `_contents` depending on whether it has been triggered by a tag
+ or by a push to master
+- Documentation for versions that are added post-hoc need a small adaption of
+ their (sphinx generated) `index.html`; the `version.html` template has to be
+ copied verbatim to the bottom, but above the navigation enabling.
+- The `index.html` in this folder has to be placed into the same folder where
+ also `_contents` is
diff --git a/doc/web-deploy/index.html b/doc/web-deploy/index.html
new file mode 100644
index 000000000..595178255
--- /dev/null
+++ b/doc/web-deploy/index.html
@@ -0,0 +1,11 @@
+
+
+
+
+ Redirecting to latest release
+
+
+
+
+
+
\ No newline at end of file