Skip to content

Commit

Permalink
docs: add Netlify configuration and apply advanced doc build (keptn#798)
Browse files Browse the repository at this point in the history
Added Netlify documentation and basic setup for documentation build.

relates: keptn#798

Signed-off-by: Simon Schrottner <[email protected]>
  • Loading branch information
aepfli committed Feb 21, 2023
1 parent d14f48f commit 74dc24e
Show file tree
Hide file tree
Showing 15 changed files with 17 additions and 327 deletions.
110 changes: 0 additions & 110 deletions .github/actions/update-documentation/action.yml

This file was deleted.

3 changes: 0 additions & 3 deletions .github/actions/update-documentation/scripts/requirements.txt

This file was deleted.

57 changes: 0 additions & 57 deletions .github/actions/update-documentation/scripts/update_docs.py

This file was deleted.

17 changes: 0 additions & 17 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
Expand All @@ -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
Expand All @@ -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 }}"
18 changes: 0 additions & 18 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 0 additions & 2 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
32 changes: 0 additions & 32 deletions docs/config.yaml

This file was deleted.

1 change: 0 additions & 1 deletion docs/config/_default/params.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

version: latest
versions:
- url: /docs/
version: development
Expand Down
5 changes: 5 additions & 0 deletions docs/config/production/params.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

versions:
- url: https://main-lifecycle-toolkit.keptn.sh
version: development
github_branch: pages
1 change: 0 additions & 1 deletion docs/content/en/docs/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ linktitle: Docs
description: Learn how to use Keptn.
cascade:
type: docs
version: latest
---
1 change: 0 additions & 1 deletion docs/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
8 changes: 5 additions & 3 deletions docs/layouts/partials/navbar-version-selector.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
{{ .Site.Params.version_menu }}
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
{{ range first 5 (sort .Site.Pages ".File.ContentBaseName" "desc") -}}
{{ range sort .Site.Pages ".File.ContentBaseName" "desc" -}}
{{ if (findRE "docs" .File.ContentBaseName) -}}
{{ $version := replaceRE "docs-" "" .File.ContentBaseName -}}
<a class="dropdown-item" href="{{ .RelPermalink }}">folder-{{ $version }}</a>
{{ $versionFile := printf "%s%s" .File.Dir "/version" -}}
{{ if fileExists $versionFile -}}
<a class="dropdown-item" href="{{ .RelPermalink }}">{{readFile ( $versionFile )}}</a>
{{ end -}}
{{ end -}}
{{ end -}}
{{ $path := "" }}
Expand Down
6 changes: 4 additions & 2 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ base = "docs/"
publish = "public/"
command = "hugo -b $DEPLOY_PRIME_URL"

[build.environment]
HUGO_VERSION = "0.105.0"
HUGO_ENABLEGITINFO = "true"

[context.deploy-preview]

[context.branch-deploy]

[context.production.environment]
HUGO_VERSION = "0.105.0"
HUGO_ENV = "production"
HUGO_ENABLEGITINFO = "true"

[context.production]
command = "hugo -b $URL"
Loading

0 comments on commit 74dc24e

Please sign in to comment.