diff --git a/.github/workflows/charts-release.yaml b/.github/workflows/charts-release.yaml index 6498ce983cd..0a0092614bf 100644 --- a/.github/workflows/charts-release.yaml +++ b/.github/workflows/charts-release.yaml @@ -186,11 +186,14 @@ jobs: echo "---" ) > website/docs/charts/${train}/${chart}/container-security.md fi + + echo "Keeping some docs safe..." # keep some docs safe mv -f website/docs/charts/${train}/${chart}/CHANGELOG.md tmp/website/docs/charts/${train}/${chart}/CHANGELOG.md || : mv -f website/docs/charts/${train}/${chart}/helm-security.md tmp/website/docs/charts/${train}/${chart}/helm-security.md || : mv -f website/docs/charts/${train}/${chart}/container-security.md tmp/website/docs/charts/${train}/${chart}/container-security.md || : + echo "Removing old docs and recreating based on charts repo..." # remove old docs everywhere and recreate based on charts repo rm -rf website/docs/charts/*/${chart} || : mkdir -p website/docs/charts/${train}/${chart} || echo "chart path already exists, continuing..." @@ -198,16 +201,19 @@ jobs: yes | cp -rf charts/${train}/${chart}/icon.png website/static/img/hotlink-ok/chart-icons/${chart}.png 2>/dev/null || : yes | cp -rf charts/${train}/${chart}/screenshots/* website/static/img/hotlink-ok/chart-screenshots/${chart}/ 2>/dev/null || : + echo "Copying back kept docs..." # Copy over kept documents mv -f tmp/website/docs/charts/${train}/${chart}/CHANGELOG.md website/docs/charts/${train}/${chart}/CHANGELOG.md 2>/dev/null || : mv -f tmp/website/docs/charts/${train}/${chart}/helm-security.md website/docs/charts/${train}/${chart}/helm-security.md 2>/dev/null || : mv -f tmp/website/docs/charts/${train}/${chart}/container-security.md website/docs/charts/${train}/${chart}/container-security.md 2>/dev/null || : + echo "Appending SCALE changelog to actual changelog..." # Append SCALE changelog to actual changelog sed -i '1d' "website/docs/charts/${train}/${chart}/CHANGELOG.md" || echo "failed to sed 1d changelog..." cat "charts/${train}/${chart}/app-changelog.md" | cat - "website/docs/charts/${train}/${chart}/CHANGELOG.md" > temp && mv temp "website/docs/charts/${train}/${chart}/CHANGELOG.md" sed -i '1s/^/---\ntitle: Changelog\n---\n\n/' "website/docs/charts/${train}/${chart}/CHANGELOG.md" || echo "failed to add changelog header..." + echo "Creating index.md..." touch website/docs/charts/${train}/${chart}/index.md ( echo "---" @@ -228,6 +234,7 @@ jobs: echo "## Available Documentation" >> website/docs/charts/${train}/${chart}/index.md echo "" >> website/docs/charts/${train}/${chart}/index.md + echo "Iterating over all files in the docs directory..." # Iterate over all files in the docs directory for file in website/docs/charts/${train}/${chart}/*.md; do # Extract the file name and first line from each file