diff --git a/.github/workflows/publish-doc.yaml b/.github/workflows/publish-doc.yaml new file mode 100644 index 00000000..77c3d70f --- /dev/null +++ b/.github/workflows/publish-doc.yaml @@ -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 "ci-bot@amazon.com" + 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 + + + diff --git a/docs/contributing/developer.md b/docs/contributing/developer.md index d53885aa..a6d8e496 100644 --- a/docs/contributing/developer.md +++ b/docs/contributing/developer.md @@ -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 diff --git a/docs/overrides/home.html b/docs/overrides/home.html index 07147f2a..82aad270 100644 --- a/docs/overrides/home.html +++ b/docs/overrides/home.html @@ -228,7 +228,7 @@
- +

AWS Gateway API Controller Documentation

diff --git a/mkdocs.yml b/mkdocs.yml index c0cd142a..59a9bed1 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -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 @@ -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: @@ -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/' \ No newline at end of file + version: + provider: mike \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index bbdc26b7..efc91a01 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 diff --git a/scripts/github-release.sh b/scripts/github-release.sh index fa7c274e..f137b75a 100755 --- a/scripts/github-release.sh +++ b/scripts/github-release.sh @@ -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