Skip to content

Commit 2826999

Browse files
committed
[docs] gh-pages deploy workflow + custom domain
- GitHub Actions workflow builds MkDocs and runs gh-deploy on push to the docs branch (full history checkout for git-revision-date; pip-cached) - requirements.txt pins mkdocs/material/plugins to the local venv versions - docs/CNAME carries docs.theprototype.app so the custom domain survives every gh-pages redeploy - add site_url for canonical links + sitemap - fix repo_url to the real remote (theprototype-app/docs) and edit_uri to the docs branch so the edit-pencil links resolve
1 parent 0327db4 commit 2826999

4 files changed

Lines changed: 54 additions & 2 deletions

File tree

‎.github/workflows/deploy.yml‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Deploy docs
2+
3+
# Builds the MkDocs site and publishes it to the gh-pages branch.
4+
# GitHub Pages must be set (repo Settings > Pages) to "Deploy from a branch"
5+
# -> gh-pages / (root). The custom domain is carried by docs/CNAME.
6+
7+
on:
8+
push:
9+
branches:
10+
- docs
11+
workflow_dispatch:
12+
13+
permissions:
14+
contents: write
15+
16+
concurrency:
17+
group: deploy-docs
18+
cancel-in-progress: false
19+
20+
jobs:
21+
build-deploy:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
with:
26+
# git-revision-date reads the full history for per-page dates.
27+
fetch-depth: 0
28+
29+
- uses: actions/setup-python@v5
30+
with:
31+
python-version: "3.12"
32+
cache: pip
33+
34+
- name: Install dependencies
35+
run: pip install -r requirements.txt
36+
37+
- name: Configure git identity
38+
run: |
39+
git config user.name "github-actions[bot]"
40+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
41+
42+
- name: Build and deploy to gh-pages
43+
run: mkdocs gh-deploy --force --clean

‎docs/CNAME‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docs.theprototype.app

‎mkdocs.yml‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
site_name: ThePrototype Docs
2+
site_url: https://docs.theprototype.app/
23
nav:
34
- Getting Started:
45
- Welcome: index.md
@@ -113,8 +114,8 @@ theme:
113114
edit: material/pencil
114115
view: material/eye
115116

116-
repo_url: https://github.com/theprototype-docs/docs
117-
edit_uri: edit/main/
117+
repo_url: https://github.com/theprototype-app/docs
118+
edit_uri: edit/docs/
118119

119120
markdown_extensions:
120121
- attr_list

‎requirements.txt‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Pinned to match the local venv so CI builds reproduce local output.
2+
mkdocs==1.6.1
3+
mkdocs-material==9.5.49
4+
mkdocs-material-extensions==1.3.1
5+
mkdocs-git-revision-date-plugin==0.3.2
6+
pymdown-extensions==10.14
7+
Pygments==2.19.1

0 commit comments

Comments
 (0)