Skip to content

Commit 275bbbf

Browse files
docs: add versioning using mike (#102)
* initial changes * fix to override, adapting ci
1 parent 0d2e977 commit 275bbbf

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

.github/workflows/build-docs.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
name: Build docs
22
on:
3-
workflow_dispatch:
4-
push:
5-
branches:
6-
- main
7-
paths:
8-
- 'docs/**'
3+
release:
4+
types:
5+
- published
96

107
jobs:
118
build-notebooks:
@@ -32,5 +29,11 @@ jobs:
3229
with:
3330
name: notebooks
3431
path: docs/notebooks
32+
- name: Extract version from release
33+
run: |
34+
# Remove the 'v' prefix and any suffix after a space
35+
VERSION=$(echo ${{ github.event.release.tag_name }} | sed 's/^v//' | sed 's/ .*$//')
36+
echo "::notice::Extracted version: $VERSION"
37+
echo "VERSION=$VERSION" >> $GITHUB_ENV
3538
- name: Build and deploy docs
36-
run: uv run mkdocs gh-deploy --force --clean --verbose
39+
run: uv run mike deploy --push --update-aliases ${{ env.VERSION }} latest

docs/overrides/main.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
{% extends "base.html" %}
22

3+
{% block outdated %}
4+
You're not viewing the latest version.
5+
<a href="{{ '../' ~ base_url }}">
6+
<strong>Click here to go to latest.</strong>
7+
</a>
8+
{% endblock %}
9+
310
{% block content %}
411
{% if page.nb_url %}
512
<a href="{{ page.nb_url }}" title="Download notebook" class="md-content__button md-icon" download>

mkdocs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
site_name: NeMo Data Designer
2+
site_url: https://nvidia-nemo.github.io/DataDesigner/
23
repo_url: https://github.com/NVIDIA-NeMo/DataDesigner
34

45
nav:
@@ -64,6 +65,8 @@ theme:
6465
extra:
6566
version:
6667
provider: mike
68+
alias: true
69+
default: latest
6770

6871
watch:
6972
- src/data_designer

0 commit comments

Comments
 (0)