Skip to content

Commit d829309

Browse files
committed
Add CI for docs
1 parent 4486f48 commit d829309

File tree

7 files changed

+953
-2
lines changed

7 files changed

+953
-2
lines changed

.github/workflows/build-docs.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Build Docs
2+
on:
3+
workflow_call:
4+
5+
jobs:
6+
build-docs:
7+
runs-on: ubuntu-22.04
8+
9+
env:
10+
GH_TOKEN: "${{ secrets.GITHUB_TOKEN}}"
11+
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Set up PDM
17+
uses: pdm-project/setup-pdm@v4
18+
with:
19+
python-version: "3.10"
20+
cache: true
21+
22+
- name: Install deps
23+
run: pdm install -d
24+
25+
- name: Build docs
26+
run: pdm docs
27+
28+
- name: set .nojeckyll for GitHub
29+
run: touch docs/build/.nojekyll
30+
31+
- name: Upload docs artifact
32+
uses: actions/upload-artifact@v4
33+
with:
34+
name: docs
35+
path: docs/build
36+
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
workflow_dispatch:
6+
7+
name: deploy-internal
8+
run-name: Deploy docs internally
9+
jobs:
10+
build-docs:
11+
uses: ./.github/workflows/build-docs.yml
12+
13+
deploy-internal:
14+
runs-on: ubuntu-latest
15+
needs: build-docs
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Download docs artifact
21+
uses: actions/download-artifact@v4
22+
with:
23+
name: docs
24+
path: docs/build
25+
26+
- uses: JamesIves/github-pages-deploy-action@v4
27+
with:
28+
folder: docs/build
29+
branch: gh-pages
30+
clean-exclude: pr-preview
31+
force: false

.github/workflows/preview-docs.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# .github/workflows/preview.yml
2+
name: Deploy PR previews
3+
concurrency: preview-${{ github.ref }}
4+
on:
5+
pull_request:
6+
types:
7+
- opened
8+
- reopened
9+
- synchronize
10+
- closed
11+
12+
jobs:
13+
build-docs:
14+
uses: ./.github/workflows/build-docs.yml
15+
16+
deploy-preview:
17+
runs-on: ubuntu-latest
18+
needs: build-docs
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Download docs artifact
24+
uses: actions/download-artifact@v4
25+
with:
26+
name: docs
27+
path: docs/build
28+
29+
- uses: rossjrw/pr-preview-action@v1
30+
with:
31+
source-dir: docs/build
32+
preview-branch: gh-pages
33+
umbrella-dir: pr-preview
34+
action: auto
35+
pages-base-url: chipflow-docs.docs.chipflow-infra.com

docs/requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@ git+https://github.com/SymbiFlow/sphinx_materialdesign_theme.git#egg=sphinx-symb
22

33
docutils
44
sphinx
5-
sphinx-autobuild
65
sphinxcontrib-wavedrom

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
4545
# ones.
4646
extensions = [
47-
'sphinxcontrib.wavedrom',
47+
'sphinxcontrib.yowasp_wavedrom',
4848
'sphinx.ext.mathjax',
4949
'sphinx.ext.todo'
5050
]

0 commit comments

Comments
 (0)