-
Notifications
You must be signed in to change notification settings - Fork 592
79 lines (70 loc) · 2.89 KB
/
release_docs.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Create release docs PR
on:
workflow_dispatch:
inputs:
tag:
description: 'The version to release (e.g. v1.2.3)'
required: true
jobs:
create_docs_pr:
timeout-minutes: ${{ fromJSON(vars.GHA_DEFAULT_TIMEOUT) }}
runs-on: ubuntu-latest
steps:
- name: Parse semver string
id: semver_parser
uses: booxmedialtd/[email protected]
with:
input_string: ${{ github.event.inputs.tag }}
version_extractor_regex: 'v(.*)$'
- name: Checkout KIC repository
uses: actions/checkout@v4
- name: Checkout docs repository
uses: actions/checkout@v4
with:
repository: kong/docs.konghq.com
path: docs.konghq.com
fetch-depth: 0
- name: Generate CRDs reference
run: |
./scripts/apidocs-gen/post-process-for-konghq.sh \
docs.konghq.com/app/_src/kubernetes-ingress-controller/reference/custom-resources-${{ steps.semver_parser.outputs.major }}.${{ steps.semver_parser.outputs.minor }}.x.md
- name: Generate flags reference
run: |
./scripts/cli-arguments-docs-gen/post-process-for-konghq.sh \
docs.konghq.com/app/_src/kubernetes-ingress-controller/reference/cli-arguments-${{ steps.semver_parser.outputs.major }}.${{ steps.semver_parser.outputs.minor }}.x.md
- name: Detect changes
id: detect-changes
run: |
if [[ `cd docs.konghq.com && git status --porcelain` ]]; then
echo "Changes detected in docs repo"
echo "HAS_CHANGES=true" >> $GITHUB_OUTPUT
else
echo "No changes detected in docs repo"
fi
- name: GPG sign the commits
uses: crazy-max/ghaction-import-gpg@cb9bde2e2525e640591a934b1fd28eef1dcaf5e5
with:
workdir: docs.konghq.com
gpg_private_key: ${{ secrets.K8S_TEAM_BOT_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.K8S_TEAM_BOT_GPG_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
- name: Create a PR in docs repo
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f
if: steps.detect-changes.outputs.HAS_CHANGES
with:
token: ${{ secrets.K8S_TEAM_BOT_GH_PAT }}
title: Update docs for KIC ${{ steps.semver_parser.outputs.fullversion }}
commit-message: Synchronize auto-generated KIC API reference
committer: Kong's Team k8s bot <[email protected]>
author: Kong's Team k8s bot <[email protected]>
signoff: true
path: docs.konghq.com
base: main
branch: kic-docs-sync
delete-branch: true
draft: true
labels: |
Kubernetes Team
review:autodoc
body: Prepares documentation for KIC ${{ steps.semver_parser.outputs.fullversion }} release.