Skip to content

Commit f02dea9

Browse files
committed
ci(docs): add MkDocs + mike GitHub Pages deploy workflow
Adds .github/workflows/docs.yml so the documentation site at examonhpc.github.io/examon is published automatically: - push to release/* -> mike deploy dev (in-development tip) - tag v* -> mike deploy <ver> latest (stable release) The doc branch loop stays silent: doc/doc2/... branches are previewed locally with mkdocs serve and only publish once merged into release/*. Existing manually-deployed versions (v0.2.x, v0.3.x, v0.4.0, latest alias) on gh-pages are untouched; the workflow only appends a new `dev` alias on first run from release/v0.5.0. Uses the org-level "Read and write permissions" enabled today, so no deploy key or PAT is required; GITHUB_TOKEN with contents:write is sufficient for `mike --push`.
1 parent ef07525 commit f02dea9

1 file changed

Lines changed: 58 additions & 0 deletions

File tree

‎.github/workflows/docs.yml‎

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Docs
2+
3+
# Publishes the MkDocs site to GitHub Pages via `mike` (versioned docs).
4+
#
5+
# Aliases on gh-pages:
6+
# - release/* push -> mike deploy dev (in-development tip)
7+
# - v* tag -> mike deploy <version> latest (stable release)
8+
#
9+
# Local doc work happens on disposable `doc` branches and is previewed with
10+
# `mkdocs serve` only; nothing publishes from those branches. To promote, merge
11+
# the doc branch into release/* and this workflow updates the `dev` site.
12+
13+
on:
14+
push:
15+
branches:
16+
- 'release/*'
17+
tags:
18+
- 'v*'
19+
20+
permissions:
21+
contents: write
22+
23+
concurrency:
24+
group: docs-deploy
25+
cancel-in-progress: false
26+
27+
jobs:
28+
publish:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout repository
32+
uses: actions/checkout@v5
33+
with:
34+
fetch-depth: 0
35+
36+
- name: Set up Python
37+
uses: actions/setup-python@v5
38+
with:
39+
python-version: '3.11'
40+
41+
- name: Install dependencies
42+
run: pip install -r requirements.txt
43+
44+
- name: Configure git for mike
45+
run: |
46+
git config user.name "github-actions[bot]"
47+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
48+
49+
- name: Deploy dev (release/* branches)
50+
if: startsWith(github.ref, 'refs/heads/release/')
51+
run: mike deploy --push dev
52+
53+
- name: Deploy versioned + latest (v* tags)
54+
if: startsWith(github.ref, 'refs/tags/v')
55+
run: |
56+
VERSION="${GITHUB_REF_NAME#v}"
57+
mike deploy --push --update-aliases "$VERSION" latest
58+
mike set-default --push latest

0 commit comments

Comments
 (0)