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:
|
2022-12-19 02:12:31 +00:00
|
|
|
- uses: actions/checkout@v3.2.0
|
2022-11-29 21:15:14 +00:00
|
|
|
- uses: actions/setup-python@v4.3.0
|
2022-11-28 00:36:48 +00:00
|
|
|
with:
|
|
|
|
python-version: 3.x
|
2022-11-29 21:15:14 +00:00
|
|
|
- uses: actions/cache@v3.0.11
|
2022-11-28 00:36:48 +00:00
|
|
|
with:
|
|
|
|
key: ${{ github.ref }}
|
|
|
|
path: .cache
|
|
|
|
- run: pip install -r docs/requirements.txt
|
|
|
|
- run: |
|
|
|
|
cp -R general docs/
|
|
|
|
cp -R images docs/
|
|
|
|
- run: mkdocs build
|
|
|
|
|
2021-01-12 15:56:18 +00:00
|
|
|
deploy:
|
2022-11-28 00:36:48 +00:00
|
|
|
if: github.event_name == 'push' && contains(fromJson('["refs/heads/master", "refs/heads/main", "refs/heads/mkdocs"]'), github.ref)
|
|
|
|
needs: build
|
2021-01-12 15:56:18 +00:00
|
|
|
name: Deploy docs
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-12-19 02:12:31 +00:00
|
|
|
- uses: actions/checkout@v3.2.0
|
2022-11-28 00:36:48 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: '0'
|
2022-11-29 21:15:14 +00:00
|
|
|
- uses: actions/setup-python@v4.3.0
|
2021-01-12 15:56:18 +00:00
|
|
|
with:
|
|
|
|
python-version: 3.x
|
2022-11-29 21:15:14 +00:00
|
|
|
- uses: actions/cache@v3.0.11
|
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
|
|
|
|
- run: |
|
|
|
|
cp -R general docs/
|
|
|
|
cp -R images docs/
|
2022-11-28 01:13:59 +00:00
|
|
|
- run: mkdocs gh-deploy --force
|