diff --git a/.github/actions/update-documentation/action.yml b/.github/actions/update-documentation/action.yml deleted file mode 100644 index 398883685d0..00000000000 --- a/.github/actions/update-documentation/action.yml +++ /dev/null @@ -1,110 +0,0 @@ -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" - 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' - - - 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: ${{ 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: 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.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 to docs repo - uses: EndBug/add-and-commit@v9 - with: - author_name: "Keptn Sandbox Bot" - author_email: "keptn-sandbox@keptn.sh" - 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 repo - uses: EndBug/add-and-commit@v9 - if: inputs.update-main == 'true' - with: - author_name: "Keptn Sandbox Bot" - author_email: "keptn-sandbox@keptn.sh" - commit: "--signoff" - cwd: ${{ inputs.examples-repo-path }} - message: "docs: update examples for version ${{ inputs.version }}" - new_branch: ${{ inputs.target-branch }} diff --git a/.github/actions/update-documentation/scripts/requirements.txt b/.github/actions/update-documentation/scripts/requirements.txt deleted file mode 100644 index 2d90c915ad6..00000000000 --- a/.github/actions/update-documentation/scripts/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -dirsync==2.2.5 -pyyaml==6.0 -argparse==1.4.0 \ No newline at end of file diff --git a/.github/actions/update-documentation/scripts/update_docs.py b/.github/actions/update-documentation/scripts/update_docs.py deleted file mode 100755 index 48e361a53ce..00000000000 --- a/.github/actions/update-documentation/scripts/update_docs.py +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env python3 -import argparse - -import yaml -from dirsync import sync - -parser = argparse.ArgumentParser(description="Keptn Documentation Updater") -parser.add_argument('--version', '-v', help='Keptn LT Version', default="development", required=True, dest='version') -parser.add_argument('--update-main', '-u', action='store_true', help='Update main version', dest='update_main') -parser.add_argument('--klt-repo', '-k', help='Keptn LT Repo Path', required=True, dest='klt_repo') -parser.add_argument('--klt-docs', '-d', help='Keptn LT Docs Repo Path', required=True, dest='klt_docs') -parser.add_argument('--klt-examples', '-e', help='Keptn LT Examples Repo Path', required=True, dest='klt_examples') - -args = parser.parse_args() - -klt_repo = args.klt_repo -klt_docs = args.klt_docs -klt_examples = args.klt_examples -version = args.version -update_main = args.update_main - -if klt_docs == "" or klt_repo == "": - print("Please provide the path to the Keptn LT and Keptn Docs Repos") - exit(1) - -# Sync the docs from the KLT repo to the docs folder, sync main-version docs to the root -sync(klt_repo + '/docs/content/en/docs', klt_docs + '/content/en/docs-' + version, 'sync', exclude=['^tmp', 'Makefile'], - create=True) - -# Update the version in the docs -with open(klt_docs + "/" + 'config.yaml', 'r') as f: - config = f.read() - data = yaml.safe_load(config) - -if "versions" not in data['params']: - data['params']['versions'] = [] - -version_exists = False -versions = data['params']['versions'] -for v in versions: - if v['version'] == version: - version_exists = True - -if not version_exists: - versions.append({'version': version, 'url': '/docs-' + version + '/'}) - -versions.sort(key=lambda x: (x['version'][0].isdigit(), x['version']), reverse=True) - -if update_main: - sync(klt_docs + '/content/en/docs-' + version, klt_docs + '/content/en/docs', 'sync', exclude=['^tmp', 'Makefile'], create=True) - data['params']['version'] = version - sync(klt_repo + '/examples', klt_examples, 'sync', exclude=['^tmp'], create=True) - - -with open(klt_docs + "/" + 'config.yaml', 'w') as file: - documents = yaml.dump(data, file) - diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index c3f60a99595..46216439ea2 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -287,23 +287,6 @@ jobs: name: ${{ matrix.config.name }}-manifest path: ${{ matrix.config.folder }}/config/rendered/release.yaml - update-docs: - name: Update Documentation - needs: - - prepare_ci_run - if: github.event_name == 'push' && needs.prepare_ci_run.outputs.NON_FORKED_AND_NON_ROBOT_RUN == 'true' - runs-on: ubuntu-22.04 - steps: - - name: Check out code - uses: actions/checkout@v3 - - - name: Update Documentation - uses: ./.github/actions/update-documentation - with: - version: "dev" - klt-repo: ${{ github.workspace }} - token: ${{ secrets.KEPTN_SANDBOX_BOT_TOKEN }} - helm_charts_build: name: Publish helm chart changes to charts repo if: github.event_name == 'push' && needs.prepare_ci_run.outputs.NON_FORKED_AND_NON_ROBOT_RUN == 'true' diff --git a/.github/workflows/release-docs.yml b/.github/workflows/release-docs.yml index a26774cbf16..5b9fea38812 100644 --- a/.github/workflows/release-docs.yml +++ b/.github/workflows/release-docs.yml @@ -19,7 +19,7 @@ jobs: uses: actions/checkout@v3 with: ref: "page" - path: "$PAGE_DIR" + path: ${{ env.PAGE_DIR }} - name: Get Latest Release Information uses: octokit/request-action@v2.x @@ -33,7 +33,7 @@ jobs: - name: Detect needed Folder Operations id: folder run: | - CURRENT_VERSION=`cat $PAGE_DIR/content/en/docs/version` + CURRENT_VERSION=`cat $DOCS_DIR/content/en/docs/version || "unknown"` echo $CURRENT_VERSION if [[ "${{ fromJson(steps.latest_release.outputs.data).tag_name }}" == "${{ github.event.release.tag_name }}" ]]; then if [[ "${{ fromJson(steps.latest_release.outputs.data).tag_name }}" != "$CURRENT_VERSION" ]]; then @@ -60,5 +60,5 @@ jobs: uses: EndBug/add-and-commit@v9 with: default_author: github_actions - cwd: "$PAGE_DIR" + cwd: ${{ env.PAGE_DIR }} message: "releasing documentation ${{ fromJson(steps.latest_release.outputs.data).tag_name }}" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 33f7630d4cf..b34dfc2f4c1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -180,21 +180,3 @@ jobs: with: tag_name: ${{ needs.release-please.outputs.tag_name }} files: manifest.yaml - - update-docs: - name: Update Documentation - needs: - - release-please - if: needs.release-please.outputs.releases_created == 'true' - runs-on: ubuntu-22.04 - steps: - - name: Check out code - uses: actions/checkout@v3 - - - name: Update Documentation - uses: ./.github/actions/update-documentation - with: - version: ${{ needs.release-please.outputs.tag_name }} - klt-repo: ${{ github.workspace }} - token: ${{ secrets.KEPTN_SANDBOX_BOT_TOKEN }} - update-main: true diff --git a/docs/Makefile b/docs/Makefile index 37dbbdb2700..385de8a3909 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -8,8 +8,6 @@ PORT := 1314 build: docker run --rm -it $(VOLUMES) $(IMAGE) -D -v -build-prod: - docker run --rm -it $(VOLUMES) $(IMAGE) -b ${URL} shell: docker run --rm -it $(VOLUMES) $(IMAGE) shell diff --git a/docs/config.yaml b/docs/config.yaml deleted file mode 100644 index 5ab78362abe..00000000000 --- a/docs/config.yaml +++ /dev/null @@ -1,32 +0,0 @@ -_merge: deep -module: - hugoVersion: - extended: true - imports: - - path: github.com/keptn-sandbox/lifecycle-toolkit-docs - ignoreConfig: false - mounts: - - source: static - target: static - - source: layouts - target: layouts - - source: data - target: data - - source: assets - target: assets - - source: archetypes - target: archetypes - - source: content/en/_index.md - target: content/en/_index.md - proxy: direct -languages: - en: - title: Docsy - contentDir: "content/en" -params: - versions: - - url: /docs/ - version: development - - url: https://lifecycle.keptn.sh - version: production - version: latest diff --git a/docs/config/_default/params.yaml b/docs/config/_default/params.yaml index 3412a331272..6f8581a48d1 100644 --- a/docs/config/_default/params.yaml +++ b/docs/config/_default/params.yaml @@ -1,5 +1,4 @@ -version: latest versions: - url: /docs/ version: development diff --git a/docs/config/production/params.yaml b/docs/config/production/params.yaml new file mode 100644 index 00000000000..833e2667853 --- /dev/null +++ b/docs/config/production/params.yaml @@ -0,0 +1,5 @@ + +versions: +- url: https://main-lifecycle-toolkit.keptn.sh + version: development +github_branch: pages \ No newline at end of file diff --git a/docs/content/en/docs/_index.md b/docs/content/en/docs/_index.md index 11e3b0d061c..fecb7357d60 100644 --- a/docs/content/en/docs/_index.md +++ b/docs/content/en/docs/_index.md @@ -4,5 +4,4 @@ linktitle: Docs description: Learn how to use Keptn. cascade: type: docs - version: latest --- \ No newline at end of file diff --git a/docs/go.mod b/docs/go.mod index 2a224c85f7c..7ae5fbaa06f 100644 --- a/docs/go.mod +++ b/docs/go.mod @@ -6,6 +6,5 @@ require github.com/keptn-sandbox/lifecycle-toolkit-docs v0.0.0-20230209144724-01 require ( github.com/google/docsy/dependencies v0.6.0 // indirect - github.com/google/docsy v0.6.0 // indirect github.com/keptn-sandbox/lifecycle-toolkit-docs v0.0.0-20230209144724-01b35a6cfc44 // indirect ) diff --git a/docs/layouts/partials/navbar-version-selector.html b/docs/layouts/partials/navbar-version-selector.html index 1fd065a5224..aeb517a4d4a 100644 --- a/docs/layouts/partials/navbar-version-selector.html +++ b/docs/layouts/partials/navbar-version-selector.html @@ -2,10 +2,12 @@ {{ .Site.Params.version_menu }}