Skip to content

Commit 4b791e1

Browse files
authored
Revert "Revert "Set up multi-version docs"" (#698)
* Revert "Revert "Set up multi-version docs"" * Remove pull request run.
1 parent 05924af commit 4b791e1

3 files changed

Lines changed: 18 additions & 6 deletions

File tree

.github/workflows/docs_build_and_deploy.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
name: Build Sphinx Docs
2424
runs-on: ubuntu-latest
2525
steps:
26-
- uses: neuroinformatics-unit/actions/build_sphinx_docs@main
26+
- uses: neuroinformatics-unit/actions/build_sphinx_docs@v2
2727
with:
2828
use-artifactci: lazy
2929

@@ -32,9 +32,14 @@ jobs:
3232
needs: build_sphinx_docs
3333
permissions:
3434
contents: write
35-
if: github.event_name == 'push'
35+
# runs on releases, push to main, or manual dispatch on main
36+
if: |
37+
(github.event_name == 'push' && github.ref_type == 'tag') ||
38+
(github.event_name == 'push' && github.ref == 'refs/heads/main') ||
39+
(github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main')
3640
runs-on: ubuntu-latest
3741
steps:
38-
- uses: neuroinformatics-unit/actions/deploy_sphinx_docs@v2
42+
- uses: neuroinformatics-unit/actions/deploy_sphinx_docs_multiversion@v2
3943
with:
4044
secret_input: ${{ secrets.GITHUB_TOKEN }}
45+
switcher-url: https://datashuttle.neuroinformatics.dev/latest/_static/switcher.json

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
**datashuttle** is a tool to automate creation, validation and transfer of neuroscience project folders.
44

5-
Learn how to [Install](https://datashuttle.neuroinformatics.dev/pages/get_started/install.html)
5+
Learn how to [Install](https://datashuttle.neuroinformatics.dev/latest/pages/get_started/install.html)
66
and
7-
[Get Started](https://datashuttle.neuroinformatics.dev/pages/get_started/index.html)
7+
[Get Started](https://datashuttle.neuroinformatics.dev/latest/pages/get_started/index.html)
88
on the
99
[**datashuttle** website](https://datashuttle.neuroinformatics.dev).
1010

docs/source/conf.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,14 @@
2323
# Retrieve the version number from the package
2424
try:
2525
release = setuptools_scm.get_version(root="../..", relative_to=__file__)
26-
release = release.split(".dev")[0] # remove dev tag and git hash
26+
release = release.split("+")[0] # remove git hash
2727
except LookupError:
2828
# if git is not initialised, still allow local build
2929
# with a dummy version
3030
release = "0.0.0"
3131

32+
doc_version = "dev" if "dev" in release else f"v{release}"
33+
3234
# -- General configuration ---------------------------------------------------
3335
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
3436

@@ -148,6 +150,11 @@
148150
"type": "fontawesome",
149151
},
150152
],
153+
"switcher": {
154+
"json_url": "https://datashuttle.neuroinformatics.dev/latest/_static/switcher.json",
155+
"version_match": doc_version,
156+
},
157+
"navbar_end": ["version-switcher", "theme-switcher", "navbar-icon-links"],
151158
"logo": {
152159
"text": f"datashuttle v{release}",
153160
"image_light": "_static/logo_light.png",

0 commit comments

Comments
 (0)