-
-
Notifications
You must be signed in to change notification settings - Fork 106
54 lines (46 loc) · 1.65 KB
/
docs-sync.yml
File metadata and controls
54 lines (46 loc) · 1.65 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
name: Sync Docs to wheels.dev
on:
workflow_call:
secrets:
WHEELS_DEV_PAT:
required: true
jobs:
sync:
runs-on: ubuntu-latest
# Docs sync should not block CI — PAT may expire independently
continue-on-error: true
steps:
- name: Checkout wheels repo
uses: actions/checkout@v4
with:
path: wheels
- name: Checkout wheels.dev repo
uses: actions/checkout@v4
with:
repository: wheels-dev/wheels.dev
token: ${{ secrets.WHEELS_DEV_PAT }}
path: wheels-dev
- name: Sync docs into wheels.dev
run: |
# Ensure destination directories exist (first sync for a new version)
mkdir -p wheels-dev/docs/3.1.0/guides
mkdir -p wheels-dev/public/images
mkdir -p wheels-dev/public/json
# Guides: mirror with delete
rsync -av --del wheels/docs/src/ wheels-dev/docs/3.1.0/guides/
# Images: additive (no delete)
rsync -av wheels/docs/src/.gitbook/assets/ wheels-dev/public/images/
# API JSON: mirror with delete
rsync -av --del wheels/docs/api/ wheels-dev/public/json/
- name: Commit and push if changed
working-directory: wheels-dev
run: |
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 docs changes to sync"
else
git commit -m "Sync docs from wheels@${GITHUB_SHA::7}"
git push
fi