File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Build and Copy Docusaurus to /docs
2+
3+ on :
4+ push :
5+ branches :
6+ - main # Only run on push to main branch
7+
8+ jobs :
9+ build-docusaurus :
10+ runs-on : ubuntu-latest
11+ defaults :
12+ run :
13+ working-directory : docusaurus
14+
15+ steps :
16+ - name : Checkout repository
17+ uses : actions/checkout@v4
18+
19+ - name : Set up Node.js
20+ uses : actions/setup-node@v4
21+ with :
22+ node-version : 18
23+
24+ - name : Install dependencies
25+ run : npm ci
26+
27+ - name : Build Docusaurus
28+ run : npm run build
29+
30+ - name : Remove old Docusaurus site from /docs (preserving important files)
31+ run : |
32+ shopt -s extglob
33+ cd ../docs
34+ rm -rf !(STYLE_GUIDE.md|PULL_REQUEST_TEMPLATE.md|ISSUE_TEMPLATE)
35+
36+ - name : Copy built site to docs/
37+ run : cp -r build/* ../docs/
38+
39+ - name : Commit and push changes to docs/
40+ run : |
41+ git config user.name "github-actions[bot]"
42+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
43+ git add ../docs
44+ git commit -m "Update Docusaurus site [skip ci]" || echo "No changes to commit"
45+ git push
You can’t perform that action at this time.
0 commit comments