Skip to content

Commit

Permalink
chore: refining configuration, adding workflow for releasing
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Schrottner <simon.schrottner@dynatrace.com>
  • Loading branch information
aepfli committed Mar 13, 2023
1 parent f5f4e04 commit a1acc34
Show file tree
Hide file tree
Showing 5 changed files with 195 additions and 0 deletions.
85 changes: 85 additions & 0 deletions .github/workflows/release-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Release Documentation

on:
workflow_call:
inputs:
tag_name:
description: "Tag for the functions runner image"
type: "string"
required: true
page_dir:
description: "Root directory of the website"
type: "string"
required: false
default: "./tmp/page/"
docs_dir:
description: "Sub directory of documentation"
type: "string"
required: false
default: "./docs"
dry_run:
description: "Flag for testing"
type: "boolean"
default: false
required: false

jobs:
release-docs:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Checkout - page branch
uses: actions/checkout@v3
with:
ref: "page"
path: ${{ inputs.page_dir }}
token: ${{ secrets.KEPTN_BOT_TOKEN }}

- name: Get Latest Release Information
uses: octokit/request-action@v2.x
id: latest_release
with:
route: GET /repos/:owner/:repository/releases/latest
repository: lifecycle-toolkit
owner: keptn
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Detect needed Folder Operations
id: folder
run: |
CURRENT_VERSION=`cat ${{ inputs.page_dir }}${{ inputs.docs_dir }}/content/en/docs/version || echo "unknown"`
echo $CURRENT_VERSION
if [[ "${{ fromJson(steps.latest_release.outputs.data).tag_name }}" == "${{ inputs.tag_name }}" ]]; then
if [[ "${{ fromJson(steps.latest_release.outputs.data).tag_name }}" != "$CURRENT_VERSION" ]]; then
echo "migrate=docs-$CURRENT_VERSION" >> $GITHUB_OUTPUT
fi
echo "name=docs" >> $GITHUB_OUTPUT
echo "latest=true" >> $GITHUB_OUTPUT
else
echo "name=docs-${{ inputs.tag_name }}" >> $GITHUB_OUTPUT
fi
- name: Move old latest release documentation folder
if: ${{steps.folder.outputs.migrate }}
run: cp -R "${{ inputs.page_dir }}${{ inputs.docs_dir }}/content/en/docs/." "${{ inputs.page_dir }}${{ inputs.docs_dir }}/content/en/${{ steps.folder.outputs.migrate }}"

- name: Copy configuration
if: ${{steps.folder.outputs.latest }}
run: |
cp -R ./docs/. "${{ inputs.page_dir }}${{ inputs.docs_dir }}"
- name: Copy documentation folder
run: |
cp -R ./docs/content/en/docs/. "${{ inputs.page_dir }}${{ inputs.docs_dir }}/content/en/${{ steps.folder.outputs.name}}"
echo "${{ inputs.tag_name }}" > "${{ inputs.page_dir }}${{ inputs.docs_dir }}/content/en/${{ steps.folder.outputs.name}}/version"
- name: Push content
if: ${{ inputs.dry_run != true }}
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
cwd: ${{ inputs.page_dir }}
message: "releasing documentation ${{ inputs.tag_name }}"
53 changes: 53 additions & 0 deletions config/_default/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
baseURL: /
contentDir: content/en
defaultContentLanguage: en
defaultContentLanguageInSubdir: false

enableEmoji: true
enableGitInfo: true
enableMissingTranslationPlaceholders: true
enableRobotsTXT: true

imaging:
anchor: smart
quality: 75
resampleFilter: CatmullRom

languages:
en:
languageCode: en
languageName: English
time_format_blog: 2006-01-02
time_format_default: 2006-01-02

markup:
goldmark:
renderer:
unsafe: true
highlight:
style: friendly
parser:
autoHeadingID: true
autoHeadingIDType: github

module:
hugoVersion:
extended: true
imports:
- disable: false
path: github.com/google/docsy
- disable: false
path: github.com/google/docsy/dependencies
proxy: direct

outputs:
home:
- HTML
page:
- HTML

permalinks: blog = "/:section/:year/:month/:day/:slug/"
taxonomies:
category: categories
tag: tags
title: keptn
57 changes: 57 additions & 0 deletions config/_default/params.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
algolia_docsearch: false
copyright: Keptn Community
description: Cloud-native application life-cycle orchestration
github_branch: main
github_project_repo: https://github.com/keptn/docs-tooling
github_repo: https://github.com/keptn/docs-tooling
github_subdir: docs
links:
developer:

user:
- desc: Development takes place here!
icon: fab fa-github
name: GitHub
url: https://github.com/keptn/
- desc: Chat with other project developers
icon: fab fa-slack
name: Slack
url: https://cloud-native.slack.com/messages/keptn
- desc: Watch videos about Keptn
icon: fab fa-youtube
name: Keptn YouTube channel
url: https://youtube.com/@keptn
- desc: Follow us on Twitter to get the latest news!
icon: fab fa-twitter
name: Twitter
url: https://twitter.com/KeptnProject
- icon: fab fa-linkedin
name: LinkedIn
url: https://www.linkedin.com/company/keptnproject
markmap:
enable: true
offlineSearch: true
slack: https://cloud-native.slack.com/messages/keptn
taxonomy:
pygmentsCodeFences: true
pygmentsUseClasses: true
pygmentsUseClassic: false
taxonomyCloud:
- tags
- categories
taxonomyCloudTitle:
- tags
- categories
taxonomyPageHeader:
- tags
- categories
ui:
breadcrumb_disable: false
footer_about_disable: false
header_search_disable: true
navbar_logo: true
sidebar_menu_compact: true
sidebar_menu_foldable: true
sidebar_menu_truncate: 1000
sidebar_search_disable: false
version_menu: Releases
Empty file added config/production/.gitkeep
Empty file.
Empty file added config/staging/.gitkeep
Empty file.

0 comments on commit a1acc34

Please sign in to comment.