Skip to content

Commit

Permalink
Enable mike for docs versioning (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
gatesn authored Sep 7, 2023
1 parent 4d5411a commit 1017cf7
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 10 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
# Needed for docs to discover gh-pages branch
fetch-depth: 0
- uses: actions/setup-python@v4
id: setup-python
with:
Expand Down Expand Up @@ -64,3 +67,10 @@ jobs:

- name: Zig Docs Build
run: poetry run python -m ziglang build docs
- name: Setup doc deploy
run: |
git config --global user.name Docs Deploy
git config --global user.email docs@dummy.bot.com
- name: MKDocs Build
run: poetry run mike deploy develop --push
if: ${{ github.ref == 'refs/heads/develop' }}
18 changes: 9 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
# Needed for docs to discover gh-pages branch
fetch-depth: 0
- uses: actions/setup-python@v4
id: setup-python
with:
Expand Down Expand Up @@ -58,17 +61,14 @@ jobs:
run: poetry install -v --only=docs
- name: Zig Docs Build
run: poetry run python -m ziglang build docs
- name: Setup doc deploy
run: |
git config --global user.name Docs Deploy
git config --global user.email docs@dummy.bot.com
- name: MKDocs Build
run: poetry run mkdocs build
run: poetry run mike deploy ${{ github.ref_name }} latest --push

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v3
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: poetry run mkdocs gh-deploy --force

3 changes: 3 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@ extra:
link: https://hub.docker.com/r/squidfunk/mkdocs-material/
- icon: fontawesome/brands/python
link: https://pypi.org/project/ziggy-pydust/
version:
provider: mike

plugins:
- include-markdown
- mike

markdown_extensions:
- admonition
Expand Down
37 changes: 36 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ black = "^23.7.0"
ziglang = "^0.11.0"
mkdocs-material = "^9.2.6"
mkdocs-include-markdown-plugin = { version = "^6.0.1", python = "<3.13" }
mike = "^1.1.2"

[tool.poetry.scripts]
pydust = "pydust.__main__:main"
Expand Down

0 comments on commit 1017cf7

Please sign in to comment.