Your app is now configured for easy deployment to GitHub Pages!
-
Install dependencies (if you haven't already):
npm install
-
Initialize Git repository (if not already done):
git init git add . git commit -m "Initial commit"
-
Create a GitHub repository:
- Go to https://github.com/new
- Create a new repository (e.g.,
breathing-shapes) - Don't initialize with README (you already have one)
-
Connect your local repo to GitHub:
git remote add origin https://github.com/YOUR-USERNAME/breathing-shapes.git git branch -M main git push -u origin main
-
Deploy with one command:
npm run deploy
-
Access your app:
- Go to your repository settings → Pages
- Your site will be live at:
https://YOUR-USERNAME.github.io/breathing-shapes/
Create a file .github/workflows/deploy.yml:
name: Deploy to GitHub Pages
on:
push:
branches: [main]
permissions:
contents: read
pages: write
id-token: write
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './dist'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4Then:
- Push this file to GitHub
- Go to Settings → Pages
- Set Source to "GitHub Actions"
- Every push to
mainwill auto-deploy!
If you have a custom domain:
-
Update vite.config.ts:
base: '/',
-
Add a
CNAMEfile in thepublic/folder:yourdomain.com -
Configure DNS with your domain provider
If your URL will be username.github.io/breathing-shapes/:
- Update vite.config.ts:
(Replace
base: '/breathing-shapes/',
breathing-shapeswith your actual repo name)
✅ vite.config.ts - Added base and build.outDir settings
✅ package.json - Added deploy script and gh-pages dependency
✅ .gitignore - Already excludes dist folder
npm run dev # Run development server
npm run build # Build for production
npm run preview # Preview production build locally
npm run deploy # Build and deploy to GitHub Pages- Check your
vite.config.tsbase path matches your repo name - Make sure GitHub Pages is enabled in repo settings
- Check browser console for 404 errors
npm run buildFix any TypeScript errors before deploying
- Make sure you've pushed to GitHub first
- Check that
gh-pagespackage is installed:npm install
After making changes:
git add .
git commit -m "Update features"
git push # If using GitHub Actions
# OR
npm run deploy # If using gh-pages packageAfter deployment, your app will be available at:
- Project site:
https://YOUR-USERNAME.github.io/REPO-NAME/ - Custom domain: Whatever you configured
Share this link anywhere!