-
Notifications
You must be signed in to change notification settings - Fork 75
52 lines (50 loc) · 1.42 KB
/
docs.yml
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
name: Build documentation
on:
push:
branches: [main]
paths:
- "docs/**"
- README.md
- .github/workflows/docs.yml
pull_request:
paths:
- "docs/**"
- README.md
- .github/workflows/docs.yml
jobs:
docs:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4 # Uses the Python version in .python-version
- name: Install poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Load virtual environment cache
id: cache
uses: actions/cache@v2
with:
path: .venv
key: ${{ runner.os }}-${{ hashFiles('poetry.lock') }}
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: scripts/setup
- name: Build documentation
run: scripts/docs
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_build
publish_branch: documentation
user_name: "github-actions[bot]"
user_email: "github-actions[bot]@users.noreply.github.com"