Skip to content

Commit ef03262

Browse files
committed
Add GitHub Pages deployment workflow
1 parent 2afcaaa commit ef03262

File tree

2 files changed

+31
-3
lines changed

2 files changed

+31
-3
lines changed

.github/workflows/deploy.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
jobs:
8+
build-and-deploy:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout 🛎️
12+
uses: actions/checkout@v3
13+
14+
- name: Setup Node.js ⚙️
15+
uses: actions/setup-node@v3
16+
with:
17+
node-version: '19'
18+
cache: 'npm'
19+
20+
- name: Install dependencies 📦
21+
run: npm ci
22+
23+
- name: Build 🔧
24+
run: npm run build
25+
26+
- name: Deploy 🚀
27+
uses: JamesIves/github-pages-deploy-action@v4
28+
with:
29+
folder: dist
30+
branch: gh-pages

vite.config.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ import path from 'path';
66
export default defineConfig({
77
plugins: [react()],
88

9-
// Adjust base path according to your deployment needs
10-
// Using '/' if deploying to a custom domain, or '/hxndev.github.io/' if deploying to a GitHub Pages project site
11-
base: '/', // Changed to root path for local development
9+
base: '/',
1210

1311
build: {
1412
outDir: 'dist',

0 commit comments

Comments
 (0)