Skip to content

Commit 9809344

Browse files
committed
ci: add a workflow for docs based on the BTD action
1 parent 7f0823c commit 9809344

File tree

2 files changed

+34
-7
lines changed

2 files changed

+34
-7
lines changed

.github/workflows/docs.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Docs
2+
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
7+
8+
jobs:
9+
10+
BuildTheDocs:
11+
name: BuildTheDocs
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
16+
- name: 'Checkout'
17+
uses: actions/checkout@v2
18+
19+
- name: 'Run BuildTheDocs and publish to GitHub Pages'
20+
uses: buildthedocs/btd@v0
21+
with:
22+
token: ${{ github.token }}
23+
24+
- name: 'Upload artifacts'
25+
uses: actions/upload-artifact@master
26+
with:
27+
name: doc
28+
path: docs/_build/html

docs/conf.py

+6-7
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import os
44
import sys
5+
from json import loads
56
from pathlib import Path
67

78
# -- Sphinx Options -----------------------------------------------------------
@@ -50,13 +51,11 @@
5051
"style_nav_header_background": "#0c479d",
5152
"home_breadcrumbs": False,
5253
}
53-
html_context = {
54-
"conf_py_path": "%s/" % Path(__file__).parent.name,
55-
"display_github": True,
56-
"github_user": "VUnit",
57-
"github_repo": "vunit",
58-
"github_version": "master/",
59-
}
54+
55+
ctx = Path(__file__).resolve().parent / 'context.json'
56+
if ctx.is_file():
57+
html_context.update(loads(ctx.open('r').read()))
58+
6059

6160
html_static_path = ["_static"]
6261

0 commit comments

Comments
 (0)