-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
81 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Deploy | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
|
||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '18' | ||
|
||
- name: Install Yarn | ||
run: npm i --g yarn | ||
|
||
- name: Install dependencies | ||
run: yarn install --immutable | ||
|
||
- name: Build project | ||
run: yarn build | ||
env: | ||
VITE_BASE_APP: '/my-dashboard/' | ||
|
||
- name: Upload production-ready build files | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: ./dist | ||
|
||
deploy: | ||
name: Deploy | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,3 +22,4 @@ dist-ssr | |
*.njsproj | ||
*.sln | ||
*.sw? | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
import { defineConfig } from 'vite' | ||
import { defineConfig, loadEnv } from 'vite' | ||
import react from '@vitejs/plugin-react' | ||
import tsconfigPaths from 'vite-tsconfig-paths' | ||
|
||
// https://vitejs.dev/config/ | ||
export default defineConfig({ | ||
plugins: [react(), tsconfigPaths()], | ||
export default defineConfig(({ mode }) => { | ||
const env = loadEnv(mode, process.cwd()) | ||
|
||
return { | ||
plugins: [react(), tsconfigPaths()], | ||
base: env.VITE_BASE_APP ? env.VITE_BASE_APP : '/', | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters