Skip to content

Commit

Permalink
Control public doc versioning by "mike" (#640)
Browse files Browse the repository at this point in the history
* Add public doc versioning by "mike"
  • Loading branch information
zijun726911 authored May 21, 2024
1 parent 31070fa commit f08ce05
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 6 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/publish-doc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: publish-doc

on:
push:
branches:
- main
jobs:
publish-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: true
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Configure git
run: |
git config --global user.email "[email protected]"
git config --global user.name "ci-bot"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install mkdocs-material mike
- name: Build
run: |
mike deploy 1.0.5 latest --update-aliases --push
mike set-default latest --allow-empty --push
4 changes: 2 additions & 2 deletions docs/contributing/developer.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,13 @@ After all test cases running finished, in the `AfterSuite()` function, it will c
## Documentations
The controller documentation is managed in `docs/` directory, and built with [mkdocs](https://www.mkdocs.org/).
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.
To build and verify your changes locally:
```sh
pip install -r requirements.txt
make docs
```
The website will be located in `site/` directory. You can also run a local dev-server by running `mkdocs serve`.
The website will be located in `site/` directory. You can also run a local dev-server by running `mike serve` or `mkdocs serve`.
## Contributing
Expand Down
2 changes: 1 addition & 1 deletion docs/overrides/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
<div class="md-grid md-typeset">
<div class="tx-hero">
<div class="tx-hero__image">
<img src="../images/controller.png" draggable="false">
<img src="./images/controller.png" draggable="false">
</div>
<div class="tx-hero__content">
<h1> AWS Gateway API Controller Documentation </h1>
Expand Down
8 changes: 5 additions & 3 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ repo_name: aws/aws-application-networking-k8s
repo_url: https://github.com/aws/aws-application-networking-k8s
edit_uri: edit/main/docs/
strict: true
site_url: https://www.gateway-api-controller.eks.aws.dev/


nav:
- Home: index.md
Expand All @@ -17,6 +19,7 @@ nav:
- TLS: guides/https.md
- Custom Domain Name: guides/custom-domain-name.md
- GRPC: guides/grpc.md
- Pod Readiness Gates: guides/pod-readiness-gates.md
- Configuration: guides/environment.md
- API Specification: api-reference.md
- API Reference:
Expand Down Expand Up @@ -111,6 +114,5 @@ extra_javascript:

extra:
generator: false
# version:
# provider: mike #mike deploy --push --update-aliases 0.1 latest
# site_url: 'https://docs.example.com/'
version:
provider: mike
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ mergedeep==1.3.4
mkdocs==1.5.3
mkdocs-material==9.4.12
mkdocs-material-extensions==1.3.1
mike==2.1.1
packaging==23.2
paginate==0.5.6
pathspec==0.11.2
Expand Down
2 changes: 2 additions & 0 deletions scripts/github-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ sed_inplace "tag: $OLD_VERSION" "tag: $RELEASE_VERSION" "$WORKSPACE_DIR"/helm/va
sed_inplace "deploy-$OLD_VERSION.yaml" "deploy-$RELEASE_VERSION.yaml" "$WORKSPACE_DIR"/docs/guides/deploy.md
sed_inplace "--version=$OLD_VERSION" "--version=$RELEASE_VERSION" "$WORKSPACE_DIR"/docs/guides/deploy.md
sed_inplace "--version=$OLD_VERSION" "--version=$RELEASE_VERSION" "$WORKSPACE_DIR"/docs/guides/getstarted.md
sed_inplace "mike deploy $OLD_VERSION" "mike deploy $RELEASE_VERSION" "$WORKSPACE_DIR"/.github/workflows/publish-doc.yml


# Build the deploy.yaml
make build-deploy
Expand Down

0 comments on commit f08ce05

Please sign in to comment.