[feat](trx-rs): add GitHub workflow to sync docs/ to wiki
Introduces a GitHub Actions workflow that mirrors the docs/ directory to the repository wiki on every push to main that touches docs/. Also supports manual dispatch via workflow_dispatch. https://claude.ai/code/session_01Hs4BtTczFdXaggpzaHFfen Signed-off-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,39 @@
|
|||||||
|
name: Sync docs to Wiki
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
paths:
|
||||||
|
- 'docs/**'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
wiki:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Checkout wiki
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
repository: ${{ github.repository }}.wiki
|
||||||
|
path: wiki
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Sync docs to wiki
|
||||||
|
run: |
|
||||||
|
rsync -av --delete --exclude='.git' docs/ wiki/
|
||||||
|
cd wiki
|
||||||
|
git config user.name "github-actions[bot]"
|
||||||
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
|
git add -A
|
||||||
|
if git diff --cached --quiet; then
|
||||||
|
echo "No wiki changes to commit."
|
||||||
|
else
|
||||||
|
git commit -m "Sync docs from ${GITHUB_SHA::8}"
|
||||||
|
git push
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user