Skip to content

Commit

Permalink
Version the Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
lapp0 authored and rlouf committed Oct 7, 2024
1 parent 0da7039 commit ef4e819
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
26 changes: 24 additions & 2 deletions .github/workflows/publish_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
push:
branches:
- main
release:
types:
- created

permissions:
contents: write
Expand All @@ -14,6 +17,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: 3.x
Expand All @@ -25,7 +30,24 @@ jobs:
restore-keys: |
mkdocs-material-
- run: pip install -r requirements-doc.txt
- name: Build documentation
- run: mkdocs build

- name: Set up Git
run: |
git config user.name ${{ github.actor }}
git config user.email ${{ github.actor }}@users.noreply.github.com
- name: Publish Tag as latest
env:
GOOGLE_ANALYTICS_KEY: ${{ secrets.GOOGLE_ANALYTICS_KEY }}
if: github.event_name == 'release'
run: |
mike deploy --push --update-aliases ${{ github.ref_name }} latest
mike set-default --push latest
- name: Publish main as unstable
env:
GOOGLE_ANALYTICS_KEY: ${{ secrets.GOOGLE_ANALYTICS_KEY }}
run: mkdocs gh-deploy --force
if: github.event_name == 'push'
run: |
mike deploy --push --update-aliases ${{ github.ref_name }} unstable
4 changes: 4 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ extra:
analytics:
provider: google
property: !ENV GOOGLE_ANALYTICS_KEY
version:
provider: mike
default: latest
alias: true

# Extensions
markdown_extensions:
Expand Down
1 change: 1 addition & 0 deletions requirements-doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ mkdocs-section-index
mkdocstrings[python]
mkdocs-git-committers-plugin-2
mkdocs-git-revision-date-localized-plugin
mike

0 comments on commit ef4e819

Please sign in to comment.