Skip to content

Commit 3195844

Browse files
committed
deployment setup
1 parent 65b5252 commit 3195844

File tree

3 files changed

+78
-20
lines changed

3 files changed

+78
-20
lines changed

.github/workflows/deploy.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- deployment # Change to 'home-page-redesign' if deploying from that branch
7+
workflow_dispatch: # Allows manual triggering
8+
9+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
10+
permissions:
11+
contents: read
12+
pages: write
13+
id-token: write
14+
15+
# Allow only one concurrent deployment
16+
concurrency:
17+
group: "pages"
18+
cancel-in-progress: false
19+
20+
jobs:
21+
build:
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
28+
- name: Setup Node.js
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: '20'
32+
cache: 'npm'
33+
34+
- name: Install dependencies
35+
run: npm ci
36+
37+
- name: Build
38+
run: npm run build
39+
40+
- name: Upload artifact
41+
uses: actions/upload-pages-artifact@v3
42+
with:
43+
path: './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+
52+
steps:
53+
- name: Deploy to GitHub Pages
54+
id: deployment
55+
uses: actions/deploy-pages@v4

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
},
1515
"devDependencies": {
1616
"@types/node": "^22.14.0",
17+
"@types/react": "^19.0.0",
18+
"@types/react-dom": "^19.0.0",
1719
"@vitejs/plugin-react": "^5.0.0",
1820
"typescript": "~5.8.2",
1921
"vite": "^6.2.0"

vite.config.ts

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
import path from 'path';
2-
import { defineConfig, loadEnv } from 'vite';
2+
import { defineConfig } from 'vite';
33
import react from '@vitejs/plugin-react';
44

5-
export default defineConfig(({ mode }) => {
6-
const env = loadEnv(mode, '.', '');
7-
return {
8-
server: {
9-
port: 3000,
10-
host: '0.0.0.0',
11-
},
12-
plugins: [react()],
13-
define: {
14-
'process.env.API_KEY': JSON.stringify(env.GEMINI_API_KEY),
15-
'process.env.GEMINI_API_KEY': JSON.stringify(env.GEMINI_API_KEY)
16-
},
17-
resolve: {
18-
alias: {
19-
'@': path.resolve(__dirname, '.'),
20-
}
21-
}
22-
};
23-
});
5+
export default defineConfig({
6+
base: '/', // Important for GitHub Pages at root domain
7+
server: {
8+
port: 3000,
9+
host: '0.0.0.0',
10+
},
11+
plugins: [react()],
12+
resolve: {
13+
alias: {
14+
'@': path.resolve(__dirname, '.'),
15+
}
16+
},
17+
publicDir: 'public',
18+
build: {
19+
outDir: 'dist',
20+
assetsDir: 'assets',
21+
// Ensure clean builds
22+
emptyOutDir: true,
23+
}
24+
});

0 commit comments

Comments
 (0)