Skip to content

Commit

Permalink
Set base path for demo site from environment variable if present
Browse files Browse the repository at this point in the history
  • Loading branch information
xenova committed May 16, 2023
1 parent be90701 commit 0b403ce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ concurrency:
group: "pages"
cancel-in-progress: false

# Set base path
env:
BASE_PATH: "/transformers.js/"

jobs:
# Single deploy job since we're just deploying
deploy:
Expand Down
4 changes: 4 additions & 0 deletions examples/demo-site/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import path from 'path';

// Needed for deploying to GitHub pages
const BASE_PATH = process.env.BASE_PATH ?? '';

export default {
// config options
base: BASE_PATH,
root: path.join(__dirname, 'src'),
build: {
outDir: path.join(__dirname, 'dist')
Expand Down

0 comments on commit 0b403ce

Please sign in to comment.