Skip to content

Commit c11c979

Browse files
committed
Add mike versioned docs
1 parent ba11a81 commit c11c979

3 files changed

Lines changed: 57 additions & 1 deletion

File tree

.github/workflows/docs.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# SPDX-FileCopyrightText: 2025 Alexandre Gomes Gaigalas <alganet@gmail.com>
2+
#
3+
# SPDX-License-Identifier: ISC
4+
5+
name: Documentation
6+
7+
on:
8+
push:
9+
branches: [main]
10+
tags:
11+
- 'v*'
12+
workflow_dispatch:
13+
14+
permissions:
15+
contents: write
16+
17+
jobs:
18+
deploy:
19+
runs-on: ubuntu-latest
20+
environment:
21+
name: github-pages
22+
steps:
23+
- uses: actions/checkout@v6
24+
with:
25+
fetch-depth: 0
26+
token: ${{ secrets.GITHUB_TOKEN }}
27+
28+
- uses: actions/setup-python@v6
29+
with:
30+
python-version: '3.13'
31+
32+
- name: Install dependencies
33+
run: |
34+
pip install -e .[dev]
35+
36+
- name: Configure Git
37+
run: |
38+
git config user.name github-actions[bot]
39+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
40+
41+
- name: Deploy dev-main docs
42+
if: github.ref == 'refs/heads/main'
43+
run: |
44+
mike deploy --push --branch website dev-main
45+
46+
- name: Deploy versioned docs
47+
if: startsWith(github.ref, 'refs/tags/v')
48+
run: |
49+
VERSION=${GITHUB_REF#refs/tags/v}
50+
mike deploy --push --update-aliases --branch website $VERSION latest
51+
mike set-default --push --branch website latest

mkdocs.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
site_name: apywire
66
site_description: A Python package for lazy object wiring and dependency injection
7-
site_url: https://github.com/alganet/apywire
7+
site_url: https://alganet.github.io/apywire/
88
repo_url: https://github.com/alganet/apywire
99
repo_name: alganet/apywire
1010

@@ -33,6 +33,10 @@ theme:
3333
- search.highlight
3434
- content.code.copy
3535

36+
extra:
37+
version:
38+
provider: mike
39+
3640
nav:
3741
- Home: index.md
3842
- Getting Started: getting-started.md

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ dev = [
4242
"flake8-pyproject",
4343
"flake8",
4444
"isort",
45+
"mike",
4546
"mkdocs-autorefs",
4647
"mkdocs-material",
4748
"mkdocs",

0 commit comments

Comments
 (0)