Skip to content

Commit

Permalink
vite variables
Browse files Browse the repository at this point in the history
  • Loading branch information
jewpaltz committed Mar 4, 2024
1 parent 1e56e74 commit 3f5bc25
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,16 @@ concurrency:
cancel-in-progress: false

jobs:

#build vue app
build:
environment:
name: github-pages
runs-on: ubuntu-latest
env:
BASE_URL: ${{ secrets.S_BASE_URL }}
S_BASE_URL: ${{ secrets.S_BASE_URL }}
E_BASE_URL: ${{ vars.BASE_URL }}
L_BASE_URL: /2024-Spring/
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -43,6 +48,9 @@ jobs:
run: npm run build
working-directory: ./client

- name: Echo
run: echo "S_BASE_URL=$S_BASE_URL E_BASE_URL=$E_BASE_URL L_BASE_URL=$L_BASE_URL"

- name: Archive production artifacts
uses: actions/upload-artifact@v2
with:
Expand Down
5 changes: 5 additions & 0 deletions client/src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ import { createRouter, createWebHistory } from 'vue-router'
import { routes } from 'vue-router/auto-routes'

console.log(`import.meta.env.BASE_URL: ${import.meta.env.BASE_URL}`)
console.log(`import.meta.env.S_BASE_URL: ${import.meta.env.S_BASE_URL}`)
console.log(`import.meta.env.E_BASE_URL: ${import.meta.env.E_BASE_URL}`)
console.log(`import.meta.env.L_BASE_URL: ${import.meta.env.L_BASE_URL}`)
console.log(`import.meta.env.VITE_BASE_URL: ${import.meta.env.VITE_BASE_URL}`)

const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes: routes
Expand Down

0 comments on commit 3f5bc25

Please sign in to comment.