Skip to content

Commit 26314e2

Browse files
committed
ci: Try mike for versions
1 parent 82f67fc commit 26314e2

3 files changed

Lines changed: 43 additions & 3 deletions

File tree

.github/workflows/docs.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
push:
55
branches:
66
- main
7+
release:
8+
types:
9+
- published
710

811
permissions:
912
contents: write
@@ -27,5 +30,21 @@ jobs:
2730
- name: Install docs dependencies
2831
run: uv sync --extra docs
2932

30-
- name: Deploy docs
31-
run: uv run mkdocs gh-deploy --force --strict
33+
- name: Configure git
34+
run: |
35+
git config user.name "github-actions[bot]"
36+
git config user.email "github-actions[bot]@users.noreply.github.com"
37+
38+
- name: Fetch gh-pages branch
39+
run: git fetch origin gh-pages --depth=1 || true
40+
41+
- name: Deploy dev docs (on push to main)
42+
if: github.event_name == 'push'
43+
run: uv run mike deploy --push dev
44+
45+
- name: Deploy versioned docs (on release)
46+
if: github.event_name == 'release'
47+
run: |
48+
VERSION="${{ github.event.release.tag_name }}"
49+
uv run mike deploy --push --update-aliases "$VERSION" latest
50+
uv run mike set-default --push latest

mkdocs.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ site_description: OpenTelemetry observability for Django with traces, logs, metr
33
site_url: https://adinhodovic.github.io/django-o11y/
44
repo_url: https://github.com/adinhodovic/django-o11y
55
repo_name: adinhodovic/django-o11y
6+
edit_uri: edit/main/docs/
67

78
theme:
89
name: material
@@ -24,13 +25,33 @@ theme:
2425
- navigation.sections
2526
- navigation.top
2627
- navigation.expand
28+
- navigation.footer
29+
- navigation.indexes
2730
- search.highlight
2831
- search.suggest
32+
- search.share
2933
- content.code.copy
3034
- content.code.annotate
35+
- content.action.edit
36+
- content.action.view
37+
- content.action.edit
38+
- content.action.view
39+
40+
extra:
41+
version:
42+
provider: mike
43+
social:
44+
- icon: fontawesome/brands/github
45+
link: https://github.com/adinhodovic/django-o11y
46+
- icon: fontawesome/brands/python
47+
link: https://pypi.org/project/django-o11y/
3148

3249
plugins:
3350
- search
51+
- mike:
52+
alias_type: symlink
53+
canonical_version: null
54+
version_selector: true
3455

3556
markdown_extensions:
3657
- admonition

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ dev-logging = ["rich>=13.0.0"]
7878
all = ["django-o11y[celery,profiling,postgres,redis,http,dev-logging]"]
7979

8080
# Documentation
81-
docs = ["mkdocs>=1.6,<2.0", "mkdocs-material>=9.5.0"]
81+
docs = ["mkdocs>=1.6,<2.0", "mkdocs-material>=9.5.0", "mike>=2.0.0"]
8282

8383
# Development dependencies
8484
dev = [

0 commit comments

Comments
 (0)