-
-
Notifications
You must be signed in to change notification settings - Fork 384
47 lines (47 loc) · 1.5 KB
/
docs.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: docs
on:
workflow_run:
workflows: ["ci"]
branches: [main, v1.51]
types:
- completed
release:
types: [published]
jobs:
docs:
permissions:
contents: write
runs-on: ubuntu-latest
if: ${{ github.event_name == 'release' || github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.4.0
virtualenvs-create: false
installer-parallel: true
virtualenvs-in-project: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ hashFiles('**/poetry.lock') }}
- name: Install App Dependencies
run: poetry install --no-interaction --with docs
- name: Build docs (preview)
if: ${{ github.event_name != 'release' && github.ref == 'refs/heads/main'}}
run: poetry run python tools/build_docs.py docs-build --version=dev
- name: Build docs (release)
if: ${{ github.event_name == 'release' && github.event.action == 'published' }}
run: poetry run python tools/build_docs.py docs-build
- name: Fetch gh pages
run: git fetch origin gh-pages --depth=1
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: docs-build