diff --git a/.github/workflows/vite-react.yml b/.github/workflows/vite-react.yml index d08863c..cae5469 100644 --- a/.github/workflows/vite-react.yml +++ b/.github/workflows/vite-react.yml @@ -1,27 +1,27 @@ -# Simple workflow for deploying static content to GitHub Pages. +# Simple workflow for deploying static content to GitHub Pages. name: Deploy static content to Pages on: - # Runs on pushes targeting the default branch. + # Runs on pushes targeting the default branch. push: - branches: ['main'] + branches: ["main"] - # Allows you to run this workflow manually from the Actions tab. + # Allows you to run this workflow manually from the Actions tab. workflow_dispatch: -# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages. +# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages. permissions: contents: read pages: write id-token: write -# Allow one concurrent deployment. +# Allow one concurrent deployment. concurrency: - group: 'pages' + group: "pages" cancel-in-progress: true jobs: - # Single deploy job since we're just deploying. + # Single deploy job since we're just deploying. deploy: environment: name: github-pages @@ -34,18 +34,18 @@ jobs: uses: actions/setup-node@v4 with: node-version: 20 - cache: 'npm' + cache: "npm" - name: Install dependencies run: npm ci - name: Build - run: npm run build + run: npm run build --base=/my-portfolio-website/ - name: Setup Pages uses: actions/configure-pages@v4 - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: - # Upload dist folder. - path: './dist' + # Upload dist folder. + path: "./dist" - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4 diff --git a/vite.config.ts b/vite.config.ts index 002592f..66756fa 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -3,6 +3,7 @@ import react from "@vitejs/plugin-react"; // https://vitejs.dev/config/ export default defineConfig({ - base: "/my-portfolio-website/", + // base: "/my-portfolio-website/", + // base: process.env.VITE_BASE || "/", plugins: [react()], });