From 9c03565d51f8fa9d699779ba7fdc8f34ba09e0ec Mon Sep 17 00:00:00 2001 From: kjeld Schouten-Lebbing Date: Mon, 22 Feb 2021 15:18:15 +0100 Subject: [PATCH] Create wiki update CI This adds a CI that automatically crafts a wiki-site from repository content --- .github/workflows/wiki-create-docs.yaml | 74 +++++++++++++++++++++++++ {.github => docs}/CODE_OF_CONDUCT | 0 {.github => docs}/CONTRIBUTING | 0 {.github => docs}/README.md | 0 4 files changed, 74 insertions(+) create mode 100644 .github/workflows/wiki-create-docs.yaml rename {.github => docs}/CODE_OF_CONDUCT (100%) rename {.github => docs}/CONTRIBUTING (100%) rename {.github => docs}/README.md (100%) diff --git a/.github/workflows/wiki-create-docs.yaml b/.github/workflows/wiki-create-docs.yaml new file mode 100644 index 00000000000..d4797cb0892 --- /dev/null +++ b/.github/workflows/wiki-create-docs.yaml @@ -0,0 +1,74 @@ +name: "Wiki: Create General Docs" + +on: + push: + branches: + - master + - charts + tags-ignore: + - '**' + +jobs: + publish-app-docs: + runs-on: ubuntu-latest + steps: + - name: Checkout-Charts + uses: actions/checkout@v2 + with: + ref: 'master' + path: 'master' + - name: Checkout-Charts + uses: actions/checkout@v2 + with: + ref: 'charts' + path: 'charts' + - name: Checkout-Charts + uses: actions/checkout@v2 + with: + repository: 'truecharts/wiki' + path: 'wiki' + token: ${{ secrets.RENOVPUSH }} + - name: Clean-Wiki + run: | + rm -Rf wiki/content + mkdir -p wiki/content + + - name: Create general wiki + run: | + cd master + for doc in docs/*; do + if [ -d "${doc}" ]; then + docname=$(basename ${doc}) + cp -Rf docs/${docname} ../wiki/content/ + fi + done + cp docs/README.md ../wiki/content/index.md || echo "readme copy failed, continuing..." + cp docs/CODE_OF_CONDUCT ../wiki/content/code_of_conduct.md || echo "CODE_OF_CONDUCT copy failed, continuing..." + cp docs/CONTRIBUTING ../wiki/content/contributing.md || echo "CONTRIBUTING copy failed, continuing..." + ls ../wiki/content/ + cd .. + + - name: Create apps wiki + run: | + cd charts + for chart in charts/*; do + if [ -d "${chart}" ]; then + chartname=$(basename ${chart}) + mkdir -p ../wiki/content/apps/${chartname} || echo "wiki path already exists, continuing..." + if [ -d "${chart}/docs" ]; then + cp -f ${chart}/docs/* ../wiki/content/apps/${chartname}/ + fi + cp ${chart}/README.md ../wiki/content/apps/${chartname}/index.md || echo "readme copy failed, continuing..." + fi + done + ls ../wiki/content/apps/ + cd .. + + - name: Commit and push updated charts + 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 diff --git a/.github/CODE_OF_CONDUCT b/docs/CODE_OF_CONDUCT similarity index 100% rename from .github/CODE_OF_CONDUCT rename to docs/CODE_OF_CONDUCT diff --git a/.github/CONTRIBUTING b/docs/CONTRIBUTING similarity index 100% rename from .github/CONTRIBUTING rename to docs/CONTRIBUTING diff --git a/.github/README.md b/docs/README.md similarity index 100% rename from .github/README.md rename to docs/README.md