File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Sync Docs to Documentation Site
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - master
7
+ paths :
8
+ - " docs/**"
9
+
10
+ jobs :
11
+ sync-docs :
12
+ runs-on : ubuntu-latest
13
+ steps :
14
+ - name : Checkout master branch
15
+ uses : actions/checkout@v4
16
+ with :
17
+ fetch-depth : 0
18
+ ref : master
19
+
20
+ - name : Set up Git
21
+ run : |
22
+ git config --global user.name "github-actions[bot]"
23
+ git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
24
+
25
+ - name : Fetch docs-website branch
26
+ run : git fetch origin docs-website:docs-website
27
+
28
+ - name : Create temporary worktree
29
+ run : git worktree add ../docs-website docs-website
30
+
31
+ - name : Sync docs to docs-website
32
+ run : |
33
+ rm -rf ../docs-website/src/content/docs/*
34
+ cp -r docs/* ../docs-website/src/content/docs/
35
+
36
+ - name : Commit and push
37
+ run : |
38
+ cd ../docs-website
39
+ git add src/content/docs/
40
+ if git diff --cached --quiet; then
41
+ echo "No changes to commit."
42
+ else
43
+ git commit -m "Sync docs from master branch"
44
+ git push origin docs-website
45
+ fi
You can’t perform that action at this time.
0 commit comments