Sync Wiki #5
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: Sync Wiki | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'wiki/**' | |
workflow_dispatch: | |
jobs: | |
sync: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Push to wiki | |
run: | | |
git clone https://${{ secrets.WIKI_TOKEN }}@github.com/${{ github.repository }}.wiki.git wiki-repo | |
rsync -av --delete wiki/ ./wiki-repo/ --exclude .git | |
cd wiki-repo | |
git config user.name WikiBot | |
git config user.email wiki_bot@users.noreply.github.com | |
git add . | |
git commit -m "docs: Update wiki" || echo "No changes to commit" | |
git push https://${{ secrets.WIKI_TOKEN }}@github.com/${{ github.repository }}.wiki.git |