Skip to content

Commit 7b9e483

Browse files
committed
Add workflow: sync docs to GitHub Wiki
1 parent a3516ef commit 7b9e483

File tree

1 file changed

+37
-0
lines changed

1 file changed

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

0 commit comments

Comments
 (0)