Skip to content

Commit

Permalink
Updated to set the base path from the GitHub Actions yml file instead.
Browse files Browse the repository at this point in the history
  • Loading branch information
nhkhai committed May 26, 2024
1 parent 48d4e03 commit c376f75
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/vite-react.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
3 changes: 2 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()],
});

0 comments on commit c376f75

Please sign in to comment.