File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed
Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Sync GitBook Content
2+
3+ on :
4+ workflow_dispatch :
5+
6+ jobs :
7+ sync-docs :
8+ runs-on : ubuntu-latest
9+ permissions :
10+ contents : write
11+
12+ steps :
13+ - name : Checkout Main
14+ uses : actions/checkout@v4
15+ with :
16+ ref : main
17+
18+ - name : Checkout gh-pages
19+ uses : actions/checkout@v4
20+ with :
21+ ref : gh-pages
22+ path : temp_gh_pages
23+
24+ - name : Sync files to docs
25+ run : |
26+ mkdir -p docs
27+ # Sync content from gh-pages to docs folder
28+ # Using rsync to handle deletion of removed files and exclusion of .git
29+ rsync -av --delete --exclude '.git' --exclude '.github' temp_gh_pages/ docs/
30+
31+ # Clean up temporary directory
32+ rm -rf temp_gh_pages
33+
34+ - name : Commit and Push
35+ uses : stefanzweifel/git-auto-commit-action@v5
36+ with :
37+ commit_message : " docs: sync from gh-pages branch"
38+ branch : main
39+ file_pattern : ' docs/'
40+
You can’t perform that action at this time.
0 commit comments