-
Notifications
You must be signed in to change notification settings - Fork 1
64 lines (61 loc) · 1.9 KB
/
deploy-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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Deploy docs
on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
- dev
workflow_dispatch:
env:
POETRY_VERSION: 1.6.1
jobs:
build-and-deploy:
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
# only support specific python version, as guidelines differ beween (minor) versions
python-version: ["3.10.13"]
os: [ubuntu-latest]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Run poetry image
uses: abatilo/actions-poetry@v2.0.0
with:
poetry-version: $POETRY_VERSION
- name: Install dependencies
run: |
poetry install --with dev
- name: Build docs
run: |
cd docs
poetry run make clean
poetry run make html
# create distinguished subdirectories for each branch
# NOTE: force_orphan will delete all files in the branch (thus main & dev could not be concurrently deployed)
- name: Deploy docs main
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main' || (github.event_name == 'pull_request' && github.base_ref == 'main')
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_dir: ./docs/build/html
publish_branch: gh-pages
keep_files: true
- name: Deploy docs dev
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/dev' || (github.event_name == 'pull_request' && github.base_ref == 'dev')
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_dir: ./docs/build/html
destination_dir: dev
publish_branch: gh-pages
keep_files: true