Skip to content

Commit 5bd2d5d

Browse files
authored
Enhance GitHub Actions workflow for demo deployment by adding GITHUB_PAGES environment variable and updating Vite configuration to support GitHub Pages base path. (#7)
1 parent 23e7860 commit 5bd2d5d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.github/workflows/deploy-demo.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ jobs:
2424
# Build job
2525
build:
2626
runs-on: ubuntu-latest
27+
env:
28+
GITHUB_PAGES: "true"
2729
steps:
2830
- name: Checkout
2931
uses: actions/checkout@v4

demo/vite.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ import react from "@vitejs/plugin-react";
33
import vike from "vike/plugin";
44

55
const isNetlify = process.env.NETLIFY === "true";
6+
const isGithubPages = process.env.GITHUB_PAGES === "true";
67

78
export default defineConfig(() => {
89
const appMode = process.env.VITE_APP_MODE || ("spa" as "spa" | "ssr");
910
console.log(`VITE_APP_MODE is "${appMode}"`);
10-
const isProduction = process.env.NODE_ENV === "production";
1111

12-
const base = isNetlify ? "/" : isProduction ? "/react-responsive-overflow-list/" : "/";
12+
const base = isNetlify ? "/" : isGithubPages ? "/react-responsive-overflow-list/" : "/";
1313

1414
const plugins = appMode === "spa" ? [react()] : [react(), vike()];
1515
return {

0 commit comments

Comments
 (0)