Skip to content

Commit 5ffccc9

Browse files
Add GitHub deployment instructions
Provide instructions for setting up a GitHub Actions pipeline to build and deploy the React application to GitHub Pages.
1 parent 4aa8874 commit 5ffccc9

File tree

2 files changed

+45
-1
lines changed

2 files changed

+45
-1
lines changed

.github/workflows/deploy.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build-and-deploy:
11+
runs-on: ubuntu-latest
12+
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: '18'
26+
cache: 'npm'
27+
28+
- name: Install dependencies
29+
run: npm ci
30+
31+
- name: Build
32+
run: npm run build
33+
34+
- name: Setup Pages
35+
uses: actions/configure-pages@v4
36+
37+
- name: Upload artifact
38+
uses: actions/upload-pages-artifact@v3
39+
with:
40+
path: './dist'
41+
42+
- name: Deploy to GitHub Pages
43+
id: deployment
44+
uses: actions/deploy-pages@v4

vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { componentTagger } from "lovable-tagger";
55

66
// https://vitejs.dev/config/
77
export default defineConfig(({ mode }) => ({
8-
base: "/",
8+
base: process.env.NODE_ENV === 'production' ? '/peppy-presenter-kit/' : '/',
99
server: {
1010
host: "::",
1111
port: 8080,

0 commit comments

Comments
 (0)