Skip to content
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

chore(ci): align docs workflow #3295

Merged
merged 4 commits into from
Dec 21, 2022
Merged
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
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ body:
attributes:
label: "**For major/minor releases only** Update Release documents"
options:
- label: Trigger [synchronize_docs](https://github.com/Kong/kubernetes-ingress-controller/blob/main/.github/workflows/synchronize_docs.yaml) workflow.
- label: Trigger [release_docs](https://github.com/Kong/kubernetes-ingress-controller/blob/main/.github/workflows/release_docs.yaml) workflow. Note that you will need to update the new version's navigation manifest (e.g. [for 2.7](https://github.com/Kong/docs.konghq.com/blob/main/app/_data/docs_nav_kic_2.7.x.yml) to use the new file after.
- label: Ensure a draft PR is created in [docs.konghq.com](https://github.com/Kong/docs.konghq.com/pulls) repository.
- label: Update articles in the new version as needed.
- label: Update `references/version-compatibility.md` to include the new versions (make sure you capture any new Kubernetes/Istio versions that have been tested)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
name: Synchronize documentation with docs.konghq.com
name: Create release docs PR

on:
workflow_dispatch: {}
workflow_dispatch:
inputs:
tag:
description: 'The version to release (e.g. v1.2.3)'
required: true

jobs:
synchronize_docs:
create_docs_pr:
runs-on: ubuntu-latest
steps:
- name: Parse semver string
id: semver_parser
uses: booxmedialtd/ws-action-parse-semver@e81ad80123156d7ddd4f6c8383e63f497f857deb
with:
input_string: ${{ github.event.inputs.tag }}
version_extractor_regex: 'v(.*)$'

- name: Checkout KIC repository
uses: actions/checkout@v3
with:
Expand All @@ -22,7 +33,7 @@ jobs:
- name: Generate docs
run: |
./scripts/apidocs-gen/post-process-for-konghq.sh \
docs.konghq.com/src/kubernetes-ingress-controller/references/custom-resources.md
docs.konghq.com/app/_src/kubernetes-ingress-controller/references/custom-resources-${{ steps.semver_parser.outputs.major }}.${{ steps.semver_parser.outputs.minor }}.x.md

- name: Detect changes
id: detect-changes
Expand All @@ -42,7 +53,7 @@ jobs:
if: steps.detect-changes.outputs.HAS_CHANGES
with:
token: ${{ secrets.K8S_TEAM_BOT_GH_PAT }}
title: Synchronize auto-generated KIC API reference
title: Update docs for KIC ${{ steps.semver_parser.outputs.fullversion }}
commit-message: Synchronize auto-generated KIC API reference
committer: Kong's Team k8s bot <team-k8s+github-bot@konghq.com>
author: Kong's Team k8s bot <team-k8s+github-bot@konghq.com>
Expand All @@ -51,7 +62,8 @@ jobs:
base: main
branch: kic-docs-sync
delete-branch: true
draft: true
labels: |
Kubernetes Team
review:autodoc
body: It synchronizes [KIC's auto-generated API reference](https://github.com/Kong/kubernetes-ingress-controller/blob/main/docs/api-reference.md).
body: Prepares documentation for KIC ${{ steps.semver_parser.outputs.fullversion }} release.
4 changes: 2 additions & 2 deletions scripts/apidocs-gen/post-process-for-konghq.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ cat "${CRD_REF_DOC}" >> "${POST_PROCESSED_DOC}"
echo "<!-- vale on -->" >> "${POST_PROCESSED_DOC}"

# Replace all description placeholders with proper include directives
sed -i '' -E \
's/<!-- (.*) description placeholder -->/{% include_cached md\/kubernetes-ingress-controller\/\1_description.md kong_version=page.kong_version %}/' \
sed -i -r \
's/<!-- (.*) description placeholder -->/{% include_cached md\/kic\/crd-ref\/\1_description.md kong_version=page.kong_version %}/' \
"${POST_PROCESSED_DOC}"