Skip to content

Commit 2cf6de5

Browse files
committed
👷 add docs CI
1 parent 8863cf6 commit 2cf6de5

File tree

3 files changed

+52
-2
lines changed

3 files changed

+52
-2
lines changed

.github/workflows/docs.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Docs
2+
3+
on:
4+
workflow_dispatch:
5+
branches:
6+
- main
7+
workflow_call:
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
docs:
14+
name: "Docs"
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-python@v5
19+
with:
20+
python-version: "3.x"
21+
cache: "pip"
22+
- name: Install package
23+
run: pip install -e .
24+
- name: Install Sphinx dependencies
25+
working-directory: docs
26+
run: pip install -r requirements.txt
27+
- name: Sphinx build
28+
working-directory: docs
29+
run: sphinx-build . _build
30+
- name: Deploy to GitHub Pages
31+
uses: peaceiris/actions-gh-pages@v4
32+
with:
33+
publish_branch: gh-pages
34+
github_token: ${{ secrets.GITHUB_TOKEN }}
35+
publish_dir: docs/_build/
36+
force_orphan: true

.github/workflows/publish.yml

+13-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@ defaults:
1010
permissions: read-all
1111

1212
jobs:
13-
build-and-publish:
13+
test:
14+
uses: ./.github/workflows/test.yml
15+
secrets: inherit
16+
publish:
17+
needs: test
18+
name: "Publish"
1419
runs-on: ubuntu-latest
1520
environment:
1621
name: pypi
@@ -99,9 +104,15 @@ jobs:
99104
rm -rf dist
100105
rm -rf $CHANGELOG_PATH
101106
docker:
102-
needs: build-and-publish
107+
needs: [ test, publish ]
103108
permissions:
104109
packages: write
105110
contents: read
106111
uses: ./.github/workflows/docker.yml
112+
secrets: inherit
113+
docs:
114+
uses: ./.github/workflows/docs.yml
115+
needs: [ test, publish ]
116+
permissions:
117+
contents: write
107118
secrets: inherit

.github/workflows/test.yml

+3
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@ on:
77
pull_request:
88
branches:
99
- master
10+
workflow_call:
1011
defaults:
1112
run:
1213
shell: bash
1314
permissions: read-all
1415

1516
jobs:
1617
analyze:
18+
name: "Analyze"
1719
runs-on: ubuntu-latest
1820
steps:
1921
- uses: actions/checkout@v4
@@ -28,6 +30,7 @@ jobs:
2830
- name: Run static analysis
2931
run: tox -e linters
3032
test:
33+
name: "Test"
3134
needs: analyze
3235
runs-on: ubuntu-latest
3336
strategy:

0 commit comments

Comments
 (0)