Update mkdocs and configure docs versioning

This commit is contained in:
François Voron
2022-05-04 10:23:42 +02:00
parent e29633204d
commit 403bec9c05
6 changed files with 89 additions and 75 deletions

View File

@@ -7,25 +7,25 @@ on:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flit
flit install --deps develop --extras oauth,redis
- name: Build
run: mkdocs build
- name: Deploy
uses: peaceiris/actions-gh-pages@v2.5.0
env:
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: ./site
- uses: actions/checkout@v3
- name: Set up Python 3.7
uses: actions/setup-python@v3
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flit
flit install --deps develop --extras oauth,redis
- name: Build
run: mkdocs build
- name: Get tag
run: |
python -c "from packaging import version; from fastapi_users import __version__; version = version.parse(__version__); print(f'DOCS_VERSION={version.major}.{version.minor}')" >> $GITHUB_ENV
- name: Deploy
run: |
git fetch origin gh-pages --depth=1
mike deploy --push --update-aliases ${{ env.DOCS_VERSION }} latest