-
Notifications
You must be signed in to change notification settings - Fork 19
57 lines (51 loc) · 1.9 KB
/
Copy pathsync-docs.yml
File metadata and controls
57 lines (51 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Sync docs to website
# Mirrors the versioned doc trees (docs/r1-alpha*) and the version manifest
# (docs/_versions.json) into the renzora/website repo whenever they change on
# main. The website's own Deploy workflow then rebuilds and ships the site,
# so a docs edit here goes live with no manual copying. Website-owned files
# (the top-level _sidebar.json, legacy unversioned doc dirs) are never
# touched — only the r1-alpha* directories (with deletions propagated) and
# _versions.json are mirrored. The manifest lives here because the AI chat's
# local docs retrieval reads it to pick the current manual version.
#
# Requires a `WEBSITE_SYNC_TOKEN` repository secret: a fine-grained PAT
# scoped to renzora/website with Contents read/write.
on:
push:
branches: [main]
paths:
- 'docs/r1-alpha*/**'
- 'docs/_versions.json'
workflow_dispatch:
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout engine
uses: actions/checkout@v4
- name: Checkout website
uses: actions/checkout@v4
with:
repository: renzora/website
token: ${{ secrets.WEBSITE_SYNC_TOKEN }}
path: website
- name: Mirror versioned doc trees
run: |
for dir in docs/r1-alpha*/; do
v=$(basename "$dir")
echo "Syncing $v"
rsync -a --delete "$dir" "website/docs/$v/"
done
cp docs/_versions.json website/docs/_versions.json
- name: Commit and push
run: |
cd website
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add docs
if git diff --cached --quiet; then
echo "Docs already in sync — nothing to push"
exit 0
fi
git commit -m "docs: sync from engine@${GITHUB_SHA::8}"
git push origin main