Skip to content

Commit 2c07ab5

Browse files
madoiscoolclaude
andcommitted
Add GitHub Actions workflow to auto-build and deploy to Pages
Builds the Docusaurus site and deploys via actions/deploy-pages on every push to main, plus manual workflow_dispatch. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent b399a53 commit 2c07ab5

1 file changed

Lines changed: 57 additions & 0 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch: # Allow manual triggering
8+
9+
# Allow GITHUB_TOKEN to deploy to GitHub Pages
10+
permissions:
11+
contents: read
12+
pages: write
13+
id-token: write
14+
15+
# Allow one concurrent deployment, cancelling in-progress runs
16+
concurrency:
17+
group: pages
18+
cancel-in-progress: false
19+
20+
jobs:
21+
build:
22+
name: Build Docusaurus
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
with:
28+
fetch-depth: 0
29+
30+
- name: Setup Node.js
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: '20'
34+
cache: npm
35+
36+
- name: Install dependencies
37+
run: npm ci
38+
39+
- name: Build website
40+
run: npm run build
41+
42+
- name: Upload Pages artifact
43+
uses: actions/upload-pages-artifact@v3
44+
with:
45+
path: build
46+
47+
deploy:
48+
name: Deploy to GitHub Pages
49+
needs: build
50+
runs-on: ubuntu-latest
51+
environment:
52+
name: github-pages
53+
url: ${{ steps.deployment.outputs.page_url }}
54+
steps:
55+
- name: Deploy to GitHub Pages
56+
id: deployment
57+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)