mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-03-14 05:34:21 -04:00
40 lines
961 B
YAML
40 lines
961 B
YAML
name: Sync wiki
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- docs/**
|
|
|
|
concurrency:
|
|
group: sync-wiki
|
|
cancel-in-progress: true
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
sync-wiki:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Clone wiki
|
|
run: |
|
|
git clone --depth 1 \
|
|
https://x-access-token:${{ github.token }}@github.com/${{ github.repository }}.wiki.git \
|
|
wiki-temp
|
|
|
|
- name: Sync docs to wiki
|
|
run: |
|
|
find wiki-temp -not -path 'wiki-temp/.git*' -type f -delete
|
|
python3 .github/scripts/sync-wiki.py
|
|
|
|
- name: Commit and push
|
|
working-directory: wiki-temp
|
|
run: |
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
git add -A
|
|
git diff --staged --quiet || git commit -m "sync from ${{ github.sha }}"
|
|
git push
|