You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1013 B
40 lines
1013 B
name: Build mkdocs and deploy to GitHub Pages
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
|
|
build:
|
|
name: Build docs
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3.5.0
|
|
- uses: actions/setup-python@v4.5.0
|
|
with:
|
|
python-version: 3.x
|
|
- uses: actions/cache@v3.3.1
|
|
with:
|
|
key: ${{ github.ref }}
|
|
path: .cache
|
|
- run: pip install -r docs/requirements.txt
|
|
- run: mkdocs build
|
|
|
|
deploy:
|
|
if: github.event_name == 'push' && contains(fromJson('["refs/heads/master", "refs/heads/main"]'), github.ref)
|
|
needs: build
|
|
name: Deploy docs
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3.5.0
|
|
with:
|
|
fetch-depth: '0'
|
|
- uses: actions/setup-python@v4.5.0
|
|
with:
|
|
python-version: 3.x
|
|
- uses: actions/cache@v3.3.1
|
|
with:
|
|
key: ${{ github.ref }}
|
|
path: .cache
|
|
- run: pip install -r docs/requirements.txt
|
|
- run: mkdocs gh-deploy --force
|