-
Notifications
You must be signed in to change notification settings - Fork 40
65 lines (54 loc) · 1.76 KB
/
JOB_generate_documentation.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
name: generate-documentation
run-name: Generate Documentation
on:
workflow_call:
secrets:
DARWIN_PY_AWS_GITHUB_CICD_ROLE:
required: true
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
env:
AWS_REGION: eu-west-1
AWS_SESSION_NAME: darwinPyDocumentation
jobs:
generate-documentation:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, "3.10"]
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref || github.ref }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install poetry setuptools
poetry install --all-extras --no-interaction --no-root
pip install --editable ".[test,ml,medical,dev,ocv]"
pip install -U sphinx sphinx_rtd_theme m2r2
- name: Parse README
run: |
rm -f README.rst&&\
m2r2 README.md&&\
mv README.rst source/
- name: Generate new docs
env:
PYTHONPATH: "."
run: |
rm -rf docs/*
sphinx-apidoc -f -o source darwin darwin/future
sphinx-build -b html source/ docs/
- name: Setup access to AWS
id: aws_assume_role
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ secrets.DARWIN_PY_AWS_GITHUB_CICD_ROLE }}
role-session-name: ${{ env.AWS_SESSION_NAME }}
aws-region: ${{ env.AWS_REGION }}
- name: Upload docs to S3
run: aws s3 cp docs/ s3://darwin-py-sdk.v7labs.com/ --recursive