Skip to content

Commit f08ce05

Browse files
authored
Control public doc versioning by "mike" (#640)
* Add public doc versioning by "mike"
1 parent 31070fa commit f08ce05

File tree

6 files changed

+44
-6
lines changed

6 files changed

+44
-6
lines changed

.github/workflows/publish-doc.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: publish-doc
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
jobs:
8+
publish-docs:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
with:
13+
fetch-depth: 0
14+
persist-credentials: true
15+
- name: Set up Python
16+
uses: actions/setup-python@v4
17+
with:
18+
python-version: '3.x'
19+
- name: Configure git
20+
run: |
21+
git config --global user.email "ci-bot@amazon.com"
22+
git config --global user.name "ci-bot"
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install mkdocs-material mike
27+
- name: Build
28+
run: |
29+
mike deploy 1.0.5 latest --update-aliases --push
30+
mike set-default latest --allow-empty --push
31+
32+
33+

docs/contributing/developer.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,13 @@ After all test cases running finished, in the `AfterSuite()` function, it will c
149149
150150
## Documentations
151151
152-
The controller documentation is managed in `docs/` directory, and built with [mkdocs](https://www.mkdocs.org/).
152+
The controller documentation is managed in `docs/` directory, and built with [mkdocs](https://www.mkdocs.org/). It uses [mike](https://github.com/jimporter/mike) to manage versioning.
153153
To build and verify your changes locally:
154154
```sh
155155
pip install -r requirements.txt
156156
make docs
157157
```
158-
The website will be located in `site/` directory. You can also run a local dev-server by running `mkdocs serve`.
158+
The website will be located in `site/` directory. You can also run a local dev-server by running `mike serve` or `mkdocs serve`.
159159
160160
## Contributing
161161

docs/overrides/home.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@
228228
<div class="md-grid md-typeset">
229229
<div class="tx-hero">
230230
<div class="tx-hero__image">
231-
<img src="../images/controller.png" draggable="false">
231+
<img src="./images/controller.png" draggable="false">
232232
</div>
233233
<div class="tx-hero__content">
234234
<h1> AWS Gateway API Controller Documentation </h1>

mkdocs.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ repo_name: aws/aws-application-networking-k8s
33
repo_url: https://github.com/aws/aws-application-networking-k8s
44
edit_uri: edit/main/docs/
55
strict: true
6+
site_url: https://www.gateway-api-controller.eks.aws.dev/
7+
68

79
nav:
810
- Home: index.md
@@ -17,6 +19,7 @@ nav:
1719
- TLS: guides/https.md
1820
- Custom Domain Name: guides/custom-domain-name.md
1921
- GRPC: guides/grpc.md
22+
- Pod Readiness Gates: guides/pod-readiness-gates.md
2023
- Configuration: guides/environment.md
2124
- API Specification: api-reference.md
2225
- API Reference:
@@ -111,6 +114,5 @@ extra_javascript:
111114

112115
extra:
113116
generator: false
114-
# version:
115-
# provider: mike #mike deploy --push --update-aliases 0.1 latest
116-
# site_url: 'https://docs.example.com/'
117+
version:
118+
provider: mike

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ mergedeep==1.3.4
1212
mkdocs==1.5.3
1313
mkdocs-material==9.4.12
1414
mkdocs-material-extensions==1.3.1
15+
mike==2.1.1
1516
packaging==23.2
1617
paginate==0.5.6
1718
pathspec==0.11.2

scripts/github-release.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ sed_inplace "tag: $OLD_VERSION" "tag: $RELEASE_VERSION" "$WORKSPACE_DIR"/helm/va
6262
sed_inplace "deploy-$OLD_VERSION.yaml" "deploy-$RELEASE_VERSION.yaml" "$WORKSPACE_DIR"/docs/guides/deploy.md
6363
sed_inplace "--version=$OLD_VERSION" "--version=$RELEASE_VERSION" "$WORKSPACE_DIR"/docs/guides/deploy.md
6464
sed_inplace "--version=$OLD_VERSION" "--version=$RELEASE_VERSION" "$WORKSPACE_DIR"/docs/guides/getstarted.md
65+
sed_inplace "mike deploy $OLD_VERSION" "mike deploy $RELEASE_VERSION" "$WORKSPACE_DIR"/.github/workflows/publish-doc.yml
66+
6567

6668
# Build the deploy.yaml
6769
make build-deploy

0 commit comments

Comments
 (0)