GitHub URL: https://github.com/staylegitlonewolf/Template1.git
# Initialize git in your project directory
git init
# Add your GitHub repository as remote
git remote add origin https://github.com/staylegitlonewolf/Template1.git
# Add all files to git
git add .
# Create initial commit
git commit -m "Initial commit: Wix Studio Headless Authentication"
# Push to GitHub
git push -u origin main
Go to your repository: https://github.com/staylegitlonewolf/Template1
Navigate to Settings β Pages
main
/ (root)
https://staylegitlonewolf.github.io/Template1/
Since youβre deploying to GitHub Pages, you need to update your Wix Studio OAuth app to allow your GitHub Pages domain:
my-studio-headless
Wix Studio Headless Auth
staylegitlonewolf.github.io
*.github.io
(already added)# Install dependencies
npm install
# Build the project
npm run build
# The build output will be in the `.next` folder
Since GitHub Pages serves static files, we need to configure Next.js for static export. Update your next.config.js
:
/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'export',
trailingSlash: true,
images: {
unoptimized: true
},
env: {
NEXT_PUBLIC_WIX_CLIENT_ID: process.env.NEXT_PUBLIC_WIX_CLIENT_ID,
NEXT_PUBLIC_WIX_SITE_ID: process.env.NEXT_PUBLIC_WIX_SITE_ID,
},
}
module.exports = nextConfig
Add a build script for GitHub Pages:
{
"scripts": {
"dev": "next dev",
"build": "next build",
"export": "next build && next export",
"start": "next start",
"lint": "next lint"
}
}
Create .github/workflows/deploy.yml
:
name: Deploy to GitHub Pages
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build project
run: npm run build
env:
NEXT_PUBLIC_WIX_CLIENT_ID: $
NEXT_PUBLIC_WIX_SITE_ID: $
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: $
publish_dir: ./out
NEXT_PUBLIC_WIX_CLIENT_ID
: 1e064af1-97ee-4c5a-8631-8f951b2f0b15
NEXT_PUBLIC_WIX_SITE_ID
: 5b2c9f91-0e9c-4f31-914c-55943f6483dc
# Push your changes
git add .
git commit -m "Configure for GitHub Pages deployment"
git push origin main
After deployment, your Wix Studio Headless authentication site will be live at: https://staylegitlonewolf.github.io/Template1/
trailingSlash: true
in next.config.js# Test production build locally
npm run build
npm run start
β
OAuth Authentication with Wix Studio
β
User Registration and Login
β
Session Management
β
Responsive Design
β
GitHub Pages Hosting
β
Automatic Deployment via GitHub Actions
Your Wix Studio Headless authentication system will be live on GitHub Pages! π