Skip to content

Commit

Permalink
fix: gh-pages deployment (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
blumendorf authored Jan 6, 2025
1 parent 6939685 commit fe45b33
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 10 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ jobs:
run: pnpm install

- name: Build
env:
DEPLOY_TARGET: gh-pages
run: pnpm build

- name: Setup Pages
Expand Down Expand Up @@ -86,7 +88,9 @@ jobs:
run: pnpm install

- name: Build for FTP
run: pnpm build --base=/
env:
DEPLOY_TARGET: ftp
run: pnpm build

- name: Deploy to FTP
uses: SamKirkland/[email protected]
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
},
"devDependencies": {
"@eslint/js": "^9.17.0",
"@types/node": "^22.10.5",
"@types/react": "^18.3.18",
"@types/react-dom": "^18.3.5",
"@vitejs/plugin-react": "^4.3.4",
Expand Down
26 changes: 21 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { defineConfig } from 'vite'
import { defineConfig, loadEnv } from 'vite'
import react from '@vitejs/plugin-react'

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
base: '/',
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '')
return {
plugins: [react()],
base: env.DEPLOY_TARGET === 'gh-pages' ? '/profile-page/' : '/',
}
})

0 comments on commit fe45b33

Please sign in to comment.