Skip to content

Commit bdfce28

Browse files
committed
feat: gitPage example
1 parent 388ab3c commit bdfce28

File tree

4 files changed

+63
-1
lines changed

4 files changed

+63
-1
lines changed

.github/workflows/deploy-pages.yml

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

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
# Dist
77
node_modules
88
dist/
9+
distExample/
910

1011
# IDE
1112
.vscode/*

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
],
2828
"scripts": {
2929
"build": "rslib build",
30+
"build:example": "rsbuild build",
31+
"preview:example": "rsbuild preview --open",
3032
"dev": "rsbuild dev --open",
3133
"semantic-release": "semantic-release"
3234
},
@@ -50,4 +52,4 @@
5052
"react": ">=16.9.0",
5153
"react-dom": ">=16.9.0"
5254
}
53-
}
55+
}

rsbuild.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,9 @@ export default defineConfig({
88
index: './example/index.tsx',
99
},
1010
},
11+
output: {
12+
distPath: {
13+
root: 'distExample',
14+
},
15+
},
1116
});

0 commit comments

Comments
 (0)