-
Notifications
You must be signed in to change notification settings - Fork 16
38 lines (33 loc) · 1.05 KB
/
upwiki.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: upload wiki
on:
push:
paths:
- '.github/workflows/upwiki.yml'
- 'docs/wiki/**'
jobs:
update-wiki:
name: Update wiki
runs-on: ubuntu-latest
steps:
- name: Pull main repo
uses: actions/checkout@v4
with:
path: main_repo
- name: Setup git
run: |
git config --global user.name github-actions[bot];
git config --global user.email 41898282+github-actions[bot]@users.noreply.github.com;
- name: Pull wiki content
run: |
mkdir wiki_repo;
cd wiki_repo;
git init;
git pull https://${{ secrets.REPO_FULL_TOKEN }}@github.com/${{ github.repository }}.wiki.git
- name: Push wiki content
run: |
rsync -av --delete main_repo/docs/wiki/ wiki_repo/ --exclude .git;
cd wiki_repo;
git add .;
if git commit -m "Update wiki content"; then
git push -f --set-upstream https://${{ secrets.REPO_FULL_TOKEN }}@github.com/${{ github.repository }}.wiki.git master;
fi