Update upwiki.yml #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |