Skip to content

Commit bc45a5f

Browse files
committed
.github: generate documentation using mkdocs
Signed-off-by: Joachim Wiberg <[email protected]>
1 parent 58db8e5 commit bc45a5f

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

.github/workflows/docs.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Dotty the Documenteer
2+
3+
on:
4+
push:
5+
paths:
6+
- 'doc/**'
7+
- 'README.md'
8+
- 'mkdocs.yml'
9+
- '.github/workflows/docs.yml'
10+
pull_request:
11+
paths:
12+
- 'doc/**'
13+
- 'README.md'
14+
- 'mkdocs.yml'
15+
- '.github/workflows/docs.yml'
16+
17+
permissions:
18+
contents: read
19+
pages: write
20+
id-token: write
21+
22+
concurrency:
23+
group: "pages"
24+
cancel-in-progress: false
25+
26+
jobs:
27+
build:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v4
32+
with:
33+
fetch-depth: 0 # Needed for git-revision-date-localized plugin
34+
35+
- name: Setup Python
36+
uses: actions/setup-python@v4
37+
with:
38+
python-version: '3.x'
39+
40+
- name: Install dependencies
41+
run: |
42+
pipx install mkdocs
43+
pipx inject mkdocs mkdocs-material
44+
pipx inject mkdocs pymdown-extensions
45+
pipx inject mkdocs mkdocs-callouts
46+
47+
- name: Build documentation
48+
run: mkdocs build
49+
50+
- name: Upload Pages artifact
51+
uses: actions/upload-pages-artifact@v3
52+
with:
53+
path: site/
54+
55+
deploy:
56+
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
57+
needs: build
58+
runs-on: ubuntu-latest
59+
environment:
60+
name: github-pages
61+
url: ${{ steps.deployment.outputs.page_url }}
62+
steps:
63+
- name: Deploy to GitHub Pages
64+
id: deployment
65+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)