Skip to content

Commit 5b4dc03

Browse files
Add Github CI action to build and publish docs (#219)
1 parent de20a6a commit 5b4dc03

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/pages.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Docs
2+
3+
on:
4+
pull_request:
5+
branches: [main, release/*]
6+
push:
7+
branches: [main, release/*]
8+
9+
# Cancel previous runs if new commit is pushed to the same PR
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
12+
cancel-in-progress: true
13+
14+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
15+
permissions:
16+
contents: read
17+
pages: write
18+
id-token: write
19+
20+
jobs:
21+
build-docs:
22+
runs-on: ubuntu-latest
23+
timeout-minutes: 15
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: actions/setup-python@v5
27+
with:
28+
python-version: "3.12"
29+
- name: Build docs
30+
run: pip install tox && tox -e build-docs
31+
- name: Upload docs artifact
32+
if: github.event_name == 'push'
33+
uses: actions/upload-pages-artifact@v3
34+
with:
35+
path: docs/build/html
36+
37+
deploy-gh-pages:
38+
if: github.event_name == 'push'
39+
needs: build-docs
40+
runs-on: ubuntu-latest
41+
environment:
42+
name: github-pages
43+
url: ${{ steps.deployment.outputs.page_url }}
44+
steps:
45+
- id: deployment
46+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)