-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: fix docs auto update again (#644)
- Loading branch information
Showing
1 changed file
with
95 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,100 +1,110 @@ | ||
name: "Update KLT Docs/Examples" | ||
description: "Update Keptn Lifecycle Toolkit Documentation and Examples" | ||
inputs: | ||
version: | ||
required: true | ||
description: "Version of the Keptn Lifecycle Toolkit Documentation to be deployed" | ||
doc-repo: | ||
required: true | ||
description: "Path to the documentation repository" | ||
default: "keptn-sandbox/lifecycle-toolkit-docs" | ||
examples-repo: | ||
required: true | ||
description: "Path to the examples repository" | ||
default: "keptn-sandbox/lifecycle-toolkit-examples" | ||
klt-repo: | ||
required: true | ||
description: "Path to the klt repository" | ||
default: "lifecycle-toolkit" | ||
update-main: | ||
description: "Update the main version of the documentation" | ||
required: true | ||
default: "false" | ||
target-branch: | ||
description: "Target branch for the documentation" | ||
default: "dev" | ||
required: true | ||
token: | ||
description: "Token to access the documentation repository" | ||
required: true | ||
version: | ||
required: true | ||
description: "Version of the Keptn Lifecycle Toolkit Documentation to be deployed" | ||
doc-repo: | ||
required: true | ||
description: "Path to the documentation repository" | ||
default: "keptn-sandbox/lifecycle-toolkit-docs" | ||
doc-repo-path: | ||
required: false | ||
description: "Path where docs repo should be checked out" | ||
default: "docs-repo" | ||
examples-repo: | ||
required: true | ||
description: "Path to the examples repository" | ||
default: "keptn-sandbox/lifecycle-toolkit-examples" | ||
examples-repo-path: | ||
required: false | ||
description: "Path where examples repo should be checked out" | ||
default: "examples-repo" | ||
klt-repo: | ||
required: true | ||
description: "Path to the klt repository" | ||
default: "lifecycle-toolkit" | ||
update-main: | ||
description: "Update the main version of the documentation" | ||
required: true | ||
default: "false" | ||
target-branch: | ||
description: "Target branch for the documentation" | ||
default: "main" | ||
required: true | ||
token: | ||
description: "Token to access the documentation repository" | ||
required: true | ||
|
||
|
||
runs: | ||
using: "composite" | ||
|
||
steps: | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Check out documentation | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: ${{ inputs.doc-repo }} | ||
path: "doc-repo" | ||
ref: "main" | ||
token: ${{ inputs.token }} | ||
fetch-depth: 0 | ||
- name: Check out documentation | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: ${{ inputs.doc-repo }} | ||
path: ${{ inputs.doc-repo-path }} | ||
ref: "main" | ||
token: ${{ inputs.token }} | ||
fetch-depth: 0 | ||
|
||
- name: Check out examples | ||
uses: actions/checkout@v3 | ||
if: inputs.update-main == 'true' | ||
with: | ||
repository: ${{ inputs.examples-repo }} | ||
path: "example-repo" | ||
ref: "main" | ||
token: ${{ inputs.token }} | ||
fetch-depth: 0 | ||
- name: Check out examples | ||
uses: actions/checkout@v3 | ||
if: inputs.update-main == 'true' | ||
with: | ||
repository: ${{ inputs.examples-repo }} | ||
path: ${{ inputs.examples-repo-path }} | ||
ref: "main" | ||
token: ${{ inputs.token }} | ||
fetch-depth: 0 | ||
|
||
- name: Install dependencies | ||
run: pip install -r .github/actions/update-documentation/scripts/requirements.txt | ||
shell: bash | ||
- name: Install dependencies | ||
run: pip install -r .github/actions/update-documentation/scripts/requirements.txt | ||
shell: bash | ||
|
||
- name: Update documentation | ||
if: inputs.main-version != 'true' | ||
shell: bash | ||
run: | | ||
python .github/actions/update-documentation/scripts/update_docs.py \ | ||
--version ${{ inputs.version }} \ | ||
--klt-docs doc-repo \ | ||
--klt-repo ${{ inputs.klt-repo }} \ | ||
--klt-examples ${{ inputs.examples-repo }} | ||
- name: Update documentation | ||
if: inputs.update-main != 'true' | ||
shell: bash | ||
run: | | ||
python .github/actions/update-documentation/scripts/update_docs.py \ | ||
--version ${{ inputs.version }} \ | ||
--klt-docs ${{ inputs.doc-repo-path }} \ | ||
--klt-repo ${{ inputs.klt-repo }} \ | ||
--klt-examples ${{ inputs.examples-repo-path }} | ||
- name: Update documentation | ||
if: inputs.main-version == 'true' | ||
shell: bash | ||
run: | | ||
python .github/actions/update-documentation/scripts/update_docs.py \ | ||
--version ${{ inputs.version }} \ | ||
--klt-docs doc-repo \ | ||
--klt-repo ${{ inputs.klt-repo }} \ | ||
--klt-examples ${{ inputs.examples-repo }} \ | ||
--update-main | ||
- name: Update documentation | ||
if: inputs.update-main == 'true' | ||
shell: bash | ||
run: | | ||
python .github/actions/update-documentation/scripts/update_docs.py \ | ||
--version ${{ inputs.version }} \ | ||
--klt-docs ${{ inputs.doc-repo-path }} \ | ||
--klt-repo ${{ inputs.klt-repo }} \ | ||
--klt-examples ${{ inputs.examples-repo-path }} \ | ||
--update-main | ||
- name: Commit changes | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
author_name: "Keptn Sandbox Bot" | ||
author_email: "[email protected]" | ||
cwd: "doc-repo" | ||
message: "Update documentation for version ${{ inputs.version }}" | ||
new_branch: ${{ inputs.target-branch }} | ||
- name: Commit changes to docs repo | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
committer_name: "Keptn Sandbox Bot" | ||
committer_email: "[email protected]" | ||
commit: "--signoff" | ||
cwd: ${{ inputs.doc-repo-path }} | ||
message: "docs: update documentation for version ${{ inputs.version }}" | ||
new_branch: ${{ inputs.target-branch }} | ||
|
||
- name: Commit changes to examples | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
author_name: Keptn Bot | ||
author_email: [email protected] | ||
cwd: examples-repo | ||
message: "Update examples for version ${{ inputs.version }}" | ||
new_branch: ${{ inputs.target-branch }} | ||
- name: Commit changes to examples repo | ||
uses: EndBug/add-and-commit@v9 | ||
if: inputs.update-main == 'true' | ||
with: | ||
author_name: "Keptn Sandbox Bot" | ||
author_email: "[email protected]" | ||
commit: "--signoff" | ||
cwd: ${{ inputs.examples-repo-path }} | ||
message: "docs: update examples for version ${{ inputs.version }}" | ||
new_branch: ${{ inputs.target-branch }} |