Skip to content

NO NOT MERGE: Versioned docs #944

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/docs-versioning.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
on:
push:
tags:
# 1. Include all semver‐style vX.Y.Z tags
- 'v*.*.*'
# 2. Exclude anything with "-rc." after the patch
- '!v*.*.*-rc.*'

permissions:
contents: write

jobs:
version-docs:
runs-on: ubuntu-latest
env:
VERSION: ${{ github.ref_name }} # picks up the tag, e.g. v0.3.0
ALIAS: latest # your “latest” alias
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # ensures tags are available
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: pip install mkdocs mike
- name: Build MkDocs site
run: mkdocs build --site-dir site
- name: Version with mike
run: |
mike deploy \
--branch main \
--push \
--update-aliases $VERSION $ALIAS \
site site-src
mike set-default \
--branch main \
--push \
$ALIAS site-src
- name: Push versioned docs
run: git push origin main
5 changes: 0 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -275,11 +275,6 @@ build-docs:
docker build --pull -t gaie/mkdocs hack/mkdocs/image
docker run --rm -v ${PWD}:/docs gaie/mkdocs build

.PHONY: build-docs-netlify
build-docs-netlify:
pip install -r hack/mkdocs/image/requirements.txt
python -m mkdocs build

.PHONY: live-docs
live-docs:
docker build -t gaie/mkdocs hack/mkdocs/image
Expand Down
2 changes: 1 addition & 1 deletion hack/mkdocs/image/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ then
exit 0;
fi

mkdocs serve --dev-addr=0.0.0.0:3000 --livereload
mkdocs serve --dev-addr=0.0.0.0:3000 --livereload
1 change: 1 addition & 0 deletions hack/mkdocs/image/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ mkdocs-material==9.5.36
mkdocs-material-extensions==1.3.1
mkdocs-redirects==1.2.1
mkdocs-mermaid2-plugin==1.1.1
mike==2.1.3
6 changes: 6 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
site_name: Kubernetes Gateway API Inference Extension
repo_url: https://github.com/kubernetes-sigs/gateway-api-inference-extension
repo_name: kubernetes-sigs/gateway-api-inference-extension
site_url: 'https://gateway-api-inference-extension.sigs.k8s.io/'
site_dir: site
docs_dir: site-src
extra:
version:
provider: mike
alias: true
extra_css:
- stylesheets/extra.css
theme:
Expand All @@ -22,6 +27,7 @@ theme:
edit_uri: edit/main/site-src/
plugins:
- search
- mike
- awesome-pages
- macros:
j2_line_comment_prefix: "#$"
Expand Down
9 changes: 5 additions & 4 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# netlify configuration
[build]
publish = "site"
command = "make build-docs-netlify"
# available here https://github.com/netlify/build-image/blob/focal/included_software.md#languages
environment = { PYTHON_VERSION = "3.8" }
command = "echo 'Nothing to build, docs are pre-generated by GitHub action!'"
publish = "site"

[context.production]
branch = "main"