98 lines
3.5 KiB
YAML
98 lines
3.5 KiB
YAML
name: "Wiki: Create Docs"
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
tags-ignore:
|
|
- '**'
|
|
|
|
jobs:
|
|
publish-app-docs:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout-Master
|
|
uses: actions/checkout@v2
|
|
with:
|
|
path: 'master'
|
|
token: ${{ secrets.RENOVPUSH }}
|
|
- name: Checkout-Wiki
|
|
uses: actions/checkout@v2
|
|
with:
|
|
repository: 'truecharts/wiki'
|
|
path: 'wiki'
|
|
token: ${{ secrets.RENOVPUSH }}
|
|
|
|
|
|
- name: install helm-docs
|
|
run: |
|
|
brew install norwoodj/tap/helm-docs
|
|
|
|
- name: (re)generate docs
|
|
run: |
|
|
cd master
|
|
.tools/gen-helm-docs.sh
|
|
cd ..
|
|
|
|
- name: Clean-Wiki
|
|
run: |
|
|
rm -Rf wiki/content
|
|
mkdir -p wiki/content
|
|
mkdir -p wiki/content/development
|
|
mkdir -p wiki/content/Other-Licences
|
|
cp -f wiki/CNAME wiki/content/CNAME
|
|
|
|
- name: Create general wiki
|
|
run: |
|
|
cd master
|
|
cp -Rf .github/docs/* ../wiki/content/
|
|
cp .github/README.md ../wiki/content/index.md || echo "readme copy failed, continuing..."
|
|
cp .github/CODE_OF_CONDUCT ../wiki/content/code_of_conduct.md || echo "CODE_OF_CONDUCT copy failed, continuing..."
|
|
cp .github/CONTRIBUTING ../wiki/content/development/contributing.md || echo "CONTRIBUTING copy failed, continuing..."
|
|
cp LICENSE ../wiki/content/legal/LICENSE.md || echo "license copy failed, continuing..."
|
|
sed -i '1s/^/# License<br>\n\n/' ../wiki/content/legal/LICENSE.md
|
|
cp NOTICE ../wiki/content/legal/NOTICE.md || echo "license copy failed, continuing..."
|
|
sed -i '1s/^/# NOTICE<br>\n\n/' ../wiki/content/legal/NOTICE.md
|
|
ls ../wiki/content/
|
|
cd ..
|
|
|
|
- name: Create apps wiki
|
|
run: |
|
|
cd master
|
|
for chart in charts/*; do
|
|
if [ -d "${chart}" ]; then
|
|
maxfolderversion=$(ls -l ${chart} | grep ^d | awk '{print $9}' | tail -n 1)
|
|
chartname=$(basename ${chart})
|
|
echo "Processing: ${chart} - folder: ${maxfolderversion}"
|
|
|
|
mkdir -p ../wiki/content/apps/${chartname} || echo "wiki path already exists, continuing..."
|
|
if [ -d "${chart}/${maxfolderversion}/docs" ]; then
|
|
cp -f ${chart}/${maxfolderversion}/docs/* ../wiki/content/apps/${chartname}/
|
|
fi
|
|
cp ${chart}/${maxfolderversion}/README.md ../wiki/content/apps/${chartname}/index.md || echo "readme copy failed, continuing..."
|
|
cp ${chart}/${maxfolderversion}/LICENSE ../wiki/content/apps/${chartname}/LICENSE.md || echo "license copy failed, continuing..."
|
|
sed -i '1s/^/# License<br>\n\n/' ../wiki/content/apps/${chartname}/LICENSE.md || echo "license edit failed, continuing..."
|
|
fi
|
|
done
|
|
ls ../wiki/content/apps/
|
|
cd ..
|
|
|
|
- name: Commit and push updated wiki
|
|
run: |
|
|
cd wiki
|
|
git config user.name "$GITHUB_ACTOR"
|
|
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
|
|
git add --all
|
|
git commit -sm "Publish general wiki updates" || exit 0
|
|
git push
|
|
cd ..
|
|
|
|
- name: Commit and push updated charts
|
|
run: |
|
|
cd master
|
|
git config user.name "$GITHUB_ACTOR"
|
|
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
|
|
git add --all
|
|
git commit -sm "Publish docs updates" || exit 0
|
|
git push
|