Skip to content

Commit 301521e

Browse files
committed
Uses mike for live-docs target
Signed-off-by: Daneyon Hansen <[email protected]>
1 parent 4c319af commit 301521e

File tree

26 files changed

+72
-12
lines changed

26 files changed

+72
-12
lines changed

.github/workflows/docs-versioning.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
on:
2+
push:
3+
tags:
4+
# 1. Include all semver‐style vX.Y.Z tags
5+
- 'v*.*.*'
6+
# 2. Exclude anything with "-rc." after the patch
7+
- '!v*.*.*-rc.*'
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
version-docs:
14+
runs-on: ubuntu-latest
15+
env:
16+
VERSION: ${{ github.ref_name }} # picks up the tag, e.g. v0.3.0
17+
ALIAS: latest # your “latest” alias
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0 # ensures tags are available
22+
- name: Set up Python
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: '3.x'
26+
- name: Install dependencies
27+
run: pip install mkdocs mike
28+
- name: Build MkDocs site
29+
run: mkdocs build --site-dir site
30+
- name: Version with mike
31+
run: |
32+
mike deploy \
33+
--branch main \
34+
--push \
35+
--update-aliases $VERSION $ALIAS \
36+
site docs
37+
mike set-default \
38+
--branch main \
39+
--push \
40+
$ALIAS docs
41+
- name: Push versioned docs
42+
run: git push origin main

Makefile

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -275,15 +275,14 @@ build-docs:
275275
docker build --pull -t gaie/mkdocs hack/mkdocs/image
276276
docker run --rm -v ${PWD}:/docs gaie/mkdocs build
277277

278-
.PHONY: build-docs-netlify
279-
build-docs-netlify:
280-
pip install -r hack/mkdocs/image/requirements.txt
281-
python -m mkdocs build
282-
283278
.PHONY: live-docs
284279
live-docs:
285-
docker build -t gaie/mkdocs hack/mkdocs/image
286-
docker run --rm -it -p 3000:3000 -v ${PWD}:/docs gaie/mkdocs
280+
docker build --pull -t gaie/mkdocs hack/mkdocs/image
281+
docker run --rm -it \
282+
-p 3000:3000 \
283+
-e DEV_ADDR="0.0.0.0:3000" \
284+
-v ${PWD}:/docs:rw \
285+
gaie/mkdocs
287286

288287
.PHONY: api-ref-docs
289288
api-ref-docs:

docs/dev.md renamed to dev/dev.md

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)