Skip to content

Commit bfe3695

Browse files
committed
ci: deploy demo to github pages
1 parent 242b04c commit bfe3695

2 files changed

Lines changed: 55 additions & 0 deletions

File tree

‎.github/workflows/deploy-demo.yml‎

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

‎packages/demo/vite.config.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ import { defineConfig } from 'vite'
22
import react from '@vitejs/plugin-react'
33

44
export default defineConfig({
5+
base: '/react-sidepanes/',
56
plugins: [react()]
67
})

0 commit comments

Comments
 (0)