-
Notifications
You must be signed in to change notification settings - Fork 41
75 lines (63 loc) · 1.71 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Build and Deploy Docs
on:
pull_request:
branches:
- '**'
push:
branches:
- main
env:
docs_artifact: docs
jobs:
context:
runs-on: ubuntu-latest
outputs:
is_release_master: ${{ steps.context.outputs.is_release_master }}
is_default_branch: ${{ steps.context.outputs.is_default_branch }}
is_fork: ${{ steps.context.outputs.is_fork }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- id: context
uses: ./.github/actions/context
docs_build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: pip install -r requirements/docs.txt
- name: Build documentation
run: make -C docs html
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'docs/_build/html'
name: ${{ env.docs_artifact }}
docs_deploy:
needs: [context, docs_build]
# Only deploy docs on a push event
# to the default branch
# that is not running on a fork
if: |
github.event_name == 'push' &&
needs.context.outputs.is_default_branch == 'true' &&
needs.context.outputs.is_fork == 'false'
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
with:
artifact_name: ${{ env.docs_artifact }}