-
-
Notifications
You must be signed in to change notification settings - Fork 483
51 lines (49 loc) · 1.55 KB
/
docs-json-export.yml
File metadata and controls
51 lines (49 loc) · 1.55 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
name: Docs JSON Export
on:
push:
branches:
- master
workflow_dispatch:
jobs:
export-docs-json:
name: Export docs.json
runs-on: ubuntu-latest
steps:
- name: Checkout repository
id: checkout
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
id: setup-python
with:
python-version: "3.13"
cache: "pip"
cache-dependency-path: "requirements/docs.txt"
check-latest: true
- name: Install dependencies
id: install-deps
run: |
python -m pip install -U pip
pip install ".[docs]"
pip install beautifulsoup4
- name: Build Sphinx HTML docs
id: build-sphinx
run: sphinx-build -b html docs docs/_build/html
- name: Export docs.json
id: generate-json
run: python scripts/docs_json_exporter.py
- name: Upload docs.json as artifact
uses: actions/upload-artifact@v7.0.0
id: artifact-upload
with:
name: Pycord Docs JSON
path: docs.json
retention-days: 1
- name: Show docs.json summary
run: |
head -n 40 docs.json || tail -n 40 docs.json
- name: Output artifact ID
run: |
echo "artifact-id=${{ steps.artifact-upload.outputs.artifact-id }}" >> $GITHUB_OUTPUT
echo "artifact-url=${{ steps.artifact-upload.outputs.artifact-url }}" >> $GITHUB_OUTPUT
echo "::notice::Artifact uploaded: ${{ steps.artifact-upload.outputs.artifact-url }}"