Skip to content

Commit 370efc2

Browse files
CopilotBoshen
andauthored
Deploy Vibe Dashboard to GitHub Pages (#6)
* Initial plan * Complete GitHub Pages deployment setup Co-authored-by: Boshen <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: Boshen <[email protected]>
1 parent a041b41 commit 370efc2

File tree

5 files changed

+76
-2
lines changed

5 files changed

+76
-2
lines changed

.github/workflows/deploy.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Deploy 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+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Setup Node.js
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: '20'
28+
29+
- name: Setup pnpm
30+
uses: pnpm/action-setup@v4
31+
with:
32+
version: '10'
33+
34+
- name: Install dependencies
35+
run: pnpm install
36+
37+
- name: Lint
38+
run: pnpm lint
39+
40+
- name: Build
41+
run: pnpm build
42+
43+
- name: Setup Pages
44+
uses: actions/configure-pages@v4
45+
46+
- name: Upload artifact
47+
uses: actions/upload-pages-artifact@v3
48+
with:
49+
path: './apps/dashboard/dist'
50+
51+
deploy:
52+
environment:
53+
name: github-pages
54+
url: ${{ steps.deployment.outputs.page_url }}
55+
runs-on: ubuntu-latest
56+
needs: build
57+
steps:
58+
- name: Deploy to GitHub Pages
59+
id: deployment
60+
uses: actions/deploy-pages@v4

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,18 @@ pnpm dev
7171
- `pnpm lint` - Run linting across all packages
7272
- `pnpm test` - Run tests across all packages
7373
- `pnpm clean` - Clean build artifacts
74+
- `pnpm build-deploy` - Lint and build for deployment
75+
76+
### Deployment
77+
78+
The dashboard is automatically deployed to GitHub Pages when changes are pushed to the `main` branch.
79+
80+
**Live Demo**: [https://boshen.github.io/vibe-dashboard/](https://boshen.github.io/vibe-dashboard/)
81+
82+
The deployment process:
83+
1. Runs linting and builds the project
84+
2. Deploys the built assets to GitHub Pages
85+
3. The app is served with the correct base path `/vibe-dashboard/`
7486

7587
## 📊 Dashboard Features
7688

apps/dashboard/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="UTF-8" />
55
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>Vite + React + TS</title>
7+
<title>Vibe Dashboard</title>
88
</head>
99
<body>
1010
<div id="root"></div>

apps/dashboard/vite.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ import react from '@vitejs/plugin-react'
44
// https://vite.dev/config/
55
export default defineConfig({
66
plugins: [react()],
7+
base: '/vibe-dashboard/',
78
})

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"build": "pnpm -r build",
99
"lint": "pnpm -r lint",
1010
"test": "pnpm -r test",
11-
"clean": "pnpm -r clean"
11+
"clean": "pnpm -r clean",
12+
"build-deploy": "pnpm lint && pnpm build"
1213
},
1314
"keywords": ["dashboard", "charts", "metrics", "frontend"],
1415
"author": "",

0 commit comments

Comments
 (0)