Merge pull request #18 from CableGuy67/wiki #23
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: Publish wiki to Wiki | |
on: | |
push: | |
paths: | |
- wiki/** | |
branches: | |
- master | |
env: | |
USER_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} | |
USER_NAME: CableGuy67 | |
USER_EMAIL: cableguy67@gmail.com | |
OWNER: ${{ github.event.repository.owner.name }} | |
REPOSITORY_NAME: ${{ github.event.repository.name }} | |
jobs: | |
publish_docs_to_wiki: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Pull wiki | |
run: | | |
mkdir tmp_wiki | |
cd tmp_wiki | |
git init | |
git config user.name $USER_NAME | |
git config user.email $USER_EMAIL | |
git pull https://$USER_TOKEN@github.com/$OWNER/$REPOSITORY_NAME.wiki.git | |
- name: Push wiki | |
run: | | |
rsync -av --delete wiki/ tmp_wiki/ --exclude .git | |
cd tmp_wiki | |
git add . | |
git commit -m "Update Wiki content" | |
git push -f --set-upstream https://$USER_TOKEN@github.com/$OWNER/$REPOSITORY_NAME.wiki.git master |