Skip to content

Wiki Content Sync

Wiki Content Sync #184

name: Wiki Content Sync
on:
push:
branches:
- main
repository_dispatch:
types: [docs]
workflow_dispatch:
gollum:
env:
GIT_AUTHOR_NAME: GitHub Action
GIT_AUTHOR_EMAIL: [email protected]
GITHUB_REPO: ${{ github.server_url }}/${{ github.repository }}/blob/main
jobs:
sync-content-to-wiki:
if: always() && format('refs/heads/{0}', github.event.repository.default_branch) == github.ref && github.event_name != 'gollum'
runs-on: [ ubuntu-latest ]
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Group Document files
run: |
rsync -av \
--exclude='.git*' \
--exclude='LICENSE' \
--include='petshop/*' \
--exclude='petshop/*/*' \
--exclude='*/example-code/' \
--exclude='schedule/archive' \
--exclude='README.md' \
--exclude='instruction/template' \
./ docs/
find docs -empty -type d -delete
cp README.md docs/Home.md
cp -ar .github/structure/. docs/
- name: Install dependencies for renaming
run: |
python3 -m pip install --upgrade pip
- name: Rewrite markdown titles, filenames, and links
run: |
python3 .github/scripts/rewrite.py docs $GITHUB_REPO
- name: Sync docs to wiki
uses: newrelic/[email protected]
with:
source: docs
destination: wiki
token: ${{ secrets.WIKI_SYNC_SECRET }}
gitAuthorName: ${{ env.GIT_AUTHOR_NAME }}
gitAuthorEmail: ${{ env.GIT_AUTHOR_EMAIL }}