2022-11-28 00:36:48 +00:00
|
|
|
name: Build mkdocs and deploy to GitHub Pages
|
2021-01-12 15:56:18 +00:00
|
|
|
|
2022-11-28 00:36:48 +00:00
|
|
|
on: [push, pull_request]
|
2021-01-12 15:56:18 +00:00
|
|
|
|
|
|
|
jobs:
|
2022-11-28 00:36:48 +00:00
|
|
|
|
|
|
|
build:
|
|
|
|
name: Build docs
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-10-25 22:04:32 +00:00
|
|
|
- uses: actions/checkout@v4.1.1
|
2023-10-09 02:09:58 +00:00
|
|
|
- uses: actions/setup-python@v4.7.1
|
2022-11-28 00:36:48 +00:00
|
|
|
with:
|
|
|
|
python-version: 3.x
|
2023-09-11 02:44:46 +00:00
|
|
|
- uses: actions/cache@v3.3.2
|
2022-11-28 00:36:48 +00:00
|
|
|
with:
|
|
|
|
key: ${{ github.ref }}
|
|
|
|
path: .cache
|
|
|
|
- run: pip install -r docs/requirements.txt
|
|
|
|
- run: mkdocs build
|
|
|
|
|
2021-01-12 15:56:18 +00:00
|
|
|
deploy:
|
2023-08-02 18:11:11 +00:00
|
|
|
if: github.event_name == 'push' && contains(fromJson('["refs/heads/master", "refs/heads/main"]'), github.ref)
|
2022-11-28 00:36:48 +00:00
|
|
|
needs: build
|
2021-01-12 15:56:18 +00:00
|
|
|
name: Deploy docs
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-10-25 22:04:32 +00:00
|
|
|
- uses: actions/checkout@v4.1.1
|
2022-11-28 00:36:48 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: '0'
|
2023-10-09 02:09:58 +00:00
|
|
|
- uses: actions/setup-python@v4.7.1
|
2021-01-12 15:56:18 +00:00
|
|
|
with:
|
|
|
|
python-version: 3.x
|
2023-09-11 02:44:46 +00:00
|
|
|
- uses: actions/cache@v3.3.2
|
2022-11-28 00:36:48 +00:00
|
|
|
with:
|
|
|
|
key: ${{ github.ref }}
|
|
|
|
path: .cache
|
2021-01-12 15:56:18 +00:00
|
|
|
- run: pip install -r docs/requirements.txt
|
2022-11-28 01:13:59 +00:00
|
|
|
- run: mkdocs gh-deploy --force
|