-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathsync-to-robotics-tutorial-wiki.yml
More file actions
72 lines (65 loc) · 2.07 KB
/
Copy pathsync-to-robotics-tutorial-wiki.yml
File metadata and controls
72 lines (65 loc) · 2.07 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Trigger Robotics Tutorial Wiki Deploy
on:
workflow_dispatch:
push:
branches: [main]
paths:
- '00_项目导航/**'
- '01_数学/**'
- '02_*/**'
- '03_SLAM/**'
- '04_移动机器人规控/**'
- '05_运动控制/**'
- '06_具身智能/**'
- 'SUMMARY.md'
- 'README.md'
- '.github/workflows/sync-to-robotics-tutorial-wiki.yml'
jobs:
trigger-deploy:
name: Trigger ${{ matrix.target.name }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target:
- name: Vercel
branch: master
- name: EdgeOne
branch: edgeone
steps:
- name: Checkout Robotics_Tutorial_Wiki
uses: actions/checkout@v4
with:
repository: Michael-Jetson/Robotics_Tutorial_Wiki
token: ${{ secrets.LOCOWIKI_PAT }}
ref: ${{ matrix.target.branch }}
fetch-depth: 0
path: wiki
- name: Configure git
run: |
cd wiki
git config user.name "Michael-Jetson"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Update source revision
run: |
cd wiki
mkdir -p .source-sync
cat > .source-sync/Robotics_Tutorial.yml <<EOF
source_repository: Michael-Jetson/Robotics_Tutorial
source_branch: ${{ github.ref_name }}
source_sha: ${{ github.sha }}
source_run_id: ${{ github.run_id }}
target_branch: ${{ matrix.target.branch }}
deploy_target: ${{ matrix.target.name }}
synced_at: $(date -u +"%Y-%m-%dT%H:%M:%SZ")
EOF
- name: Commit and push
run: |
cd wiki
git add .source-sync/Robotics_Tutorial.yml
if git diff --cached --quiet; then
echo "No deployment trigger changes for ${{ matrix.target.branch }}"
exit 0
fi
git commit -m "chore: trigger docs deploy from Robotics_Tutorial@${{ github.sha }}"
git push origin HEAD:${{ matrix.target.branch }}