-
Notifications
You must be signed in to change notification settings - Fork 53
71 lines (63 loc) · 1.73 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
name: Docs
on:
workflow_dispatch:
workflow_call:
push:
branches: ["main"]
pull_request:
types: [opened, synchronize, ready_for_review]
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: Docs-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
set-debug:
name: Set debug flag
runs-on: ubuntu-latest
outputs:
debug: ${{ steps.set-debug.outputs.debug }}
steps:
- id: set-debug
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" || "${{ github.event_name }}" == "workflow_call" ]]; then
echo "DEBUG=${{ github.event.inputs.debug_enabled }}" >> $GITHUB_ENV
else
echo "DEBUG=false" >> $GITHUB_ENV
fi
build:
name: Build documentation
runs-on: ubuntu-latest
needs: set-debug
strategy:
matrix:
python_version: ['3.10']
steps:
- uses: actions/checkout@v4
- name: Setup environment
uses: ./.github/actions/setup_environment
with:
python_version: ${{ matrix.python_version }}
debug_enabled: ${{ needs.set-debug.outputs.debug }}
- name: Build
run: make docs-build
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./site
deploy:
name: Deploy documentation
environment:
name: ${{ github.ref == 'refs/heads/main' && 'github-pages' || 'github-pages-dev' }}
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2