From 837718944dcfd97f925cffe47710f397fbd4f319 Mon Sep 17 00:00:00 2001 From: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Date: Tue, 12 Jul 2022 23:38:48 +0300 Subject: [PATCH] chore(docs): changes to CI doc generation (#3153) * chore(docs): changes to CI doc generation * remove comment * copy icon.png to website * rename to chart-icons * ensure the correct paths exists * remove per app licenses * Apply suggestions from code review * Update .github/workflows/charts-release.yaml * Update .github/workflows/charts-release.yaml * Update .github/workflows/charts-release.yaml * update CHANGELOG tpl * another version * space between `---` * Update .github/workflows/charts-release.yaml Co-authored-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Co-authored-by: Kjeld Schouten-Lebbing --- .chglog/CHANGELOG.tpl.md | 9 ++++----- .github/workflows/charts-release.yaml | 26 +++++++++++++------------- templates/docs/README.md.gotmpl | 2 ++ 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/.chglog/CHANGELOG.tpl.md b/.chglog/CHANGELOG.tpl.md index b6106bb0a05..7a1191b90f8 100644 --- a/.chglog/CHANGELOG.tpl.md +++ b/.chglog/CHANGELOG.tpl.md @@ -1,18 +1,17 @@ {{ range .Versions }} - -### {{ if .Tag.Previous }}[{{ .Tag.Name }}]({{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}){{ else }}{{ .Tag.Name }}{{ end }} ({{ datetime "2006-01-02" .Tag.Date }}) +## [{{ .Tag.Name }}]{{ if .Tag.Previous }}({{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}){{ else }}{{ .Tag.Name }}{{ end }} ({{ datetime "2006-01-02" .Tag.Date }}) {{ range .CommitGroups -}} -#### {{ .Title }} +### {{ .Title }} {{ range .Commits -}} -* {{ .Subject }} +- {{ .Subject }} {{ end }} {{ end -}} {{- if .NoteGroups -}} {{ range .NoteGroups -}} -#### {{ .Title }} +### {{ .Title }} {{ range .Notes }} {{ .Body }} diff --git a/.github/workflows/charts-release.yaml b/.github/workflows/charts-release.yaml index e22dbcae5b2..3d2983533b8 100644 --- a/.github/workflows/charts-release.yaml +++ b/.github/workflows/charts-release.yaml @@ -75,9 +75,9 @@ jobs: steps.collect-changes.outputs.changesDetectedAfterTag == 'true' with: fetch-depth: 1 - repository: truecharts/pub + repository: truecharts/website token: ${{ secrets.BOT_TOKEN }} - path: pub + path: website - name: Copy docs to website if: | @@ -86,6 +86,8 @@ jobs: run: | #!/bin/bash CHARTS=(${{ steps.collect-changes.outputs.modifiedChartsAfterTag }}) + mkdir -p website/static/img/chart-icons || echo "chart-icons path already exists, continuing..." + rm -rf website/charts/* for i in "${CHARTS[@]}" do IFS='/' read -r -a chart_parts <<< "$i" @@ -93,13 +95,11 @@ jobs: train=${chart_parts[0]} chart=${chart_parts[1]} echo "copying docs to website for ${chart}" - mkdir -p docs/apps/${train}/${chart} || echo "app path already exists, continuing..." - yes | cp -rf charts/${train}/${chart}/README.md pub/website/apps/${train}/${chart}/index.md 2>/dev/null || : - yes | cp -rf charts/${train}/${chart}/CHANGELOG.md pub/website/apps/${train}/${chart}/CHANGELOG.md 2>/dev/null || : - yes | cp -rf charts/${train}/${chart}/security.md pub/website/apps/${train}/${chart}/security.md 2>/dev/null || : - rm pub/website/apps/${train}/${chart}/LICENSE.md 2>/dev/null || : - yes | cp -rf charts/${train}/${chart}/LICENSE pub/website/apps/${train}/${chart}/LICENSE.md 2>/dev/null || : - sed -i '1s/^/# License
\n\n/' pub/website/apps/${train}/${chart}/LICENSE.md 2>/dev/null || : + mkdir -p website/docs/charts/${train}/${chart} || echo "chart path already exists, continuing..." + yes | cp -rf charts/${train}/${chart}/README.md website/docs/charts/${train}/${chart}/index.md 2>/dev/null || : + yes | cp -rf charts/${train}/${chart}/CHANGELOG.md website/docs/charts/${train}/${chart}/CHANGELOG.md 2>/dev/null || : + yes | cp -rf charts/${train}/${chart}/docs/* website/docs/charts/${train}/${chart}/ 2>/dev/null || : + yes | cp -rf charts/${train}/${chart}/icon.png website/static/img/chart-icons/${chart}.png 2>/dev/null || : fi done @@ -130,14 +130,14 @@ jobs: if: | steps.collect-changes.outputs.changesDetected == 'true' run: | - cd pub + cd website git config user.name "TrueCharts-Bot" git config user.email "bot@truecharts.org" git add --all git commit -sm "Commit released docs for TrueCharts" || exit 0 git push cd - - rm -rf pub + rm -rf website - name: Checkout uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3 @@ -198,7 +198,7 @@ jobs: git config user.name "TrueCharts-Bot" git config user.email "bot@truecharts.org" git add --all - git commit -sm "Commit new App releases for TrueCharts" || exit 0 + git commit -sm "Commit new Chart releases for TrueCharts" || exit 0 git push cd - rm -rf catalog @@ -211,7 +211,7 @@ jobs: git config user.name "TrueCharts-Bot" git config user.email "bot@truecharts.org" git add --all - git commit -sm "Commit new App releases for TrueCharts" || exit 0 + git commit -sm "Commit new Chart releases for TrueCharts" || exit 0 git push cd - rm -rf dh_catalog diff --git a/templates/docs/README.md.gotmpl b/templates/docs/README.md.gotmpl index fcca94a5584..9c5c24d99fc 100644 --- a/templates/docs/README.md.gotmpl +++ b/templates/docs/README.md.gotmpl @@ -75,5 +75,7 @@ All Rights Reserved - The TrueCharts Project {{ template "custom.linking" . }} {{ template "custom.support" . }} + --- + {{ template "custom.copyright" . }}