Skip to content

Commit 7ac24a9

Browse files
taylorarndtCopilot
andcommitted
Add sync-docs-to-wiki workflow
Auto-syncs docs/ to the GitHub Wiki on every push to main that touches docs/. Also supports manual workflow_dispatch. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 88ab6df commit 7ac24a9

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Sync docs to Wiki
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths:
7+
- 'docs/**'
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
sync:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Configure git
23+
run: |
24+
git config --global user.name "github-actions[bot]"
25+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
26+
27+
- name: Clone GitHub Wiki
28+
run: |
29+
git clone https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.wiki.git wiki
30+
31+
- name: Sync docs to wiki
32+
run: |
33+
rsync -av --delete docs/ wiki/
34+
cd wiki
35+
git add -A
36+
if [ -n "$(git status --porcelain)" ]; then
37+
git commit -m "Sync docs from repository [skip ci]"
38+
git push origin HEAD
39+
else
40+
echo "No changes to commit"
41+
fi

0 commit comments

Comments
 (0)