Skip to content

Commit ee50560

Browse files
committed
Add docs workflow to GitHub actions
1 parent 7794d86 commit ee50560

1 file changed

Lines changed: 66 additions & 0 deletions

File tree

.github/workflows/docs.yaml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Docs
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
concurrency:
18+
group: pages
19+
cancel-in-progress: false
20+
21+
env:
22+
PYTHONDONTWRITEBYTECODE: 1
23+
PYTHON_VERSION: "3.12"
24+
25+
jobs:
26+
build:
27+
name: Build MkDocs Site 🔨
28+
runs-on: ubuntu-latest
29+
30+
steps:
31+
- name: Checkout repo 🛎️
32+
uses: actions/checkout@v6
33+
with:
34+
persist-credentials: false
35+
36+
- name: Set up Python 🐍
37+
uses: actions/setup-python@v6
38+
with:
39+
python-version: ${{ env.PYTHON_VERSION }}
40+
cache: pip
41+
42+
- name: Install dependencies 📦
43+
run: pip install mkdocs mkdocs-material
44+
45+
- name: Build MkDocs site 🏗️
46+
run: mkdocs build --strict --verbose
47+
48+
- name: Upload artifact 📤
49+
uses: actions/deploy-pages@v4
50+
with:
51+
path: ./site
52+
53+
deploy:
54+
name: Deploy to GitHub Pages 🚀
55+
runs-on: ubuntu-latest
56+
needs: build
57+
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
58+
59+
environment:
60+
name: github-pages
61+
url: ${{ steps.deployment.outputs.page_url }}
62+
63+
steps:
64+
- name: Deploy to GitHub Pages 🌐
65+
id: deployment
66+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)