Skip to content

Merge pull request #184 from ssawczyn/ssawczyn/issue183 #14

Merge pull request #184 from ssawczyn/ssawczyn/issue183

Merge pull request #184 from ssawczyn/ssawczyn/issue183 #14

name: Sync docs to Wiki
on:
push:
branches: [ main ]
paths:
- 'docs/**'
workflow_dispatch:
permissions:
contents: write
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Clone GitHub Wiki
run: |
git clone https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.wiki.git wiki
- name: Sync docs to wiki
run: |
rsync -av --delete --exclude='.git' docs/ wiki/
cd wiki
git add -A
if [ -n "$(git status --porcelain)" ]; then
git commit -m "Sync docs from repository [skip ci]"
git push origin HEAD
else
echo "No changes to commit"
fi