Skip to content
Discussion options

You must be logged in to vote

Hi there 👋

To deploy your Vite project to the root of your GitHub Pages site (e.g., https://org.github.io), you need to configure both the repository and Vite build settings correctly. Changing url: ${{ steps.deployment.outputs.page_url }} will not affect the deployment location — that value is informational only.

🔹 Steps to deploy to the root

  1. Use a repository named after your organization or user
  • Example: org.github.io
  • GitHub Pages uses this repo for the root domain automatically.
  1. Set Vite base path
// vite.config.js
export default {
  base: '/',
}
  1. Use GitHub Actions to build and deploy
name: Deploy to GitHub Pages
on:
  push:
    branches: [ main ]

jobs:
  deploy:
    runs-on:…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mikeaustin
Comment options

Answer selected by mikeaustin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Actions Build, test, and automate your deployment pipeline with world-class CI/CD Question Ask and answer questions about GitHub features and usage Workflow Deployment Topics about deploying workflows, publishing artifacts, and deployment targets in GitHub Actions. Workflow Configuration Topics about workflow files, YAML setup, job dependencies, and general workflow configuration issues
2 participants