psOff_public/.github/workflows/upwiki.yml

40 lines
1.1 KiB
YAML

name: upload wiki
on:
push:
branches: [main]
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/markdown/ 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