Skip to content

Commit c98b3e4

Browse files
fholgerarmintaenzertng
authored andcommitted
Add GH workflow to generate API docs and deploy them to GH Pages
Signed-off-by: Holger Frydrych <[email protected]>
1 parent 119298f commit c98b3e4

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/docs.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# SPDX-FileCopyrightText: 2023 spdx contributors
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
name: Generate API docs
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v3
19+
- name: Setup Python
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: '3.11'
23+
- name: Install dependencies
24+
run: |
25+
sudo apt-get install graphviz-dev
26+
pip install -e ".[test,graph_generation]"
27+
pip install pdoc
28+
- name: Generate docs
29+
run: pdoc spdx_tools -o docs/
30+
- name: Upload docs as artifact
31+
uses: actions/upload-pages-artifact@v1
32+
with:
33+
path: docs/
34+
35+
deploy:
36+
needs: build
37+
runs-on: ubuntu-latest
38+
permissions:
39+
pages: write
40+
id-token: write
41+
environment:
42+
name: github-pages
43+
url: ${{ steps.deployment.outputs.page_url }}
44+
steps:
45+
- id: deployment
46+
name: Deploy docs to GitHub pages
47+
uses: actions/deploy-pages@v2

0 commit comments

Comments
 (0)