Skip to content

Commit b8bcef8

Browse files
Amit Chowdharycursoragent
andcommitted
ci: add GitHub Actions workflow to auto-deploy docs to gh-pages
Triggers on push to main when docs/** or the workflow itself changes. Builds the Docusaurus site under Node 22 with cached npm deps and publishes to the existing gh-pages branch via peaceiris/actions-gh-pages, authored by github-actions[bot]. Runs are serialized via a concurrency group so overlapping pushes don't race. Also exposes workflow_dispatch for ad-hoc manual deploys. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent df62ab0 commit b8bcef8

1 file changed

Lines changed: 54 additions & 0 deletions

File tree

.github/workflows/deploy-docs.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Deploy Docusaurus to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'docs/**'
8+
- '.github/workflows/deploy-docs.yml'
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: write
13+
14+
# Only one deploy at a time. Don't cancel an in-flight one — let it finish so
15+
# gh-pages history stays consistent.
16+
concurrency:
17+
group: deploy-docs
18+
cancel-in-progress: false
19+
20+
jobs:
21+
build-and-deploy:
22+
name: Build and deploy
23+
runs-on: ubuntu-latest
24+
timeout-minutes: 10
25+
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
30+
- name: Set up Node.js
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: '22'
34+
cache: 'npm'
35+
cache-dependency-path: docs/package-lock.json
36+
37+
- name: Install dependencies
38+
working-directory: docs
39+
run: npm ci
40+
41+
- name: Build site
42+
working-directory: docs
43+
run: npm run build
44+
45+
- name: Deploy to gh-pages branch
46+
uses: peaceiris/actions-gh-pages@v4
47+
with:
48+
github_token: ${{ secrets.GITHUB_TOKEN }}
49+
publish_dir: docs/build
50+
publish_branch: gh-pages
51+
user_name: 'github-actions[bot]'
52+
user_email: '41898282+github-actions[bot]@users.noreply.github.com'
53+
commit_message: 'docs: deploy ${{ github.sha }}'
54+
force_orphan: false

0 commit comments

Comments
 (0)