-
Notifications
You must be signed in to change notification settings - Fork 12
69 lines (56 loc) · 2.41 KB
/
Copy pathdocs.yml
File metadata and controls
69 lines (56 loc) · 2.41 KB
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
65
66
67
68
name: Docs CI
on:
push:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Source
uses: actions/checkout@v2
with:
# require all of history to see all tagged versions' docs
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.7"
- name: Install Packages
# Can delete this if you don't use graphviz in your docs
run: sudo apt-get install graphviz
- name: Install Python Dependencies
run: |
pip install pipenv
pipenv install --dev --deploy --python $(which python) && pipenv graph
- name: Deploy index
# We pin to the SHA, not the tag, for security reasons.
# https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
uses: peaceiris/actions-gh-pages@bbdfb200618d235585ad98e965f4aafc39b4c501 # v3.7.3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: .github/pages
keep_files: true
- name: Checkout gh-pages
# As we already did a deploy of gh-pages above, it is guaranteed to be there
# so check it out so we can selectively build docs below
uses: actions/checkout@v2
with:
ref: gh-pages
path: build/html
- name: Maybe use sphinx-multiversion
# If we are building master or a tag we will publish
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags')
# So use the args we normally pass to sphinx-build, but run sphinx-multiversion
run: mv $(pipenv --venv)/bin/sphinx-multiversion $(pipenv --venv)/bin/sphinx-build
- name: Build Docs
run: pipenv run docs
- name: Publish Docs to gh-pages
# Only master and tags are published
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags')
# We pin to the SHA, not the tag, for security reasons.
# https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
uses: peaceiris/actions-gh-pages@bbdfb200618d235585ad98e965f4aafc39b4c501 # v3.7.3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: build/html
keep_files: true