6.1 KiB
Deployment Guide
This guide explains how to upload the documentation to GitHub and deploy it online.
Table of Contents
Automatic Upload (Recommended)
Prerequisites
- Git installed on your system
- GitHub account credentials or Personal Access Token
Steps
- Navigate to the project directory:
cd /path/to/xui-one-api-docs
- Run the upload script:
./upload-to-github.sh
-
Follow the prompts:
- Enter commit message (or press Enter for default)
- Provide GitHub credentials when prompted
-
Done! Your documentation is now on GitHub.
Manual Upload
If you prefer manual control or the automatic script doesn't work:
Step 1: Initialize Git
cd /path/to/xui-one-api-docs
git init
Step 2: Add Remote
git remote add origin https://github.com/worldofiptvcom/xui-one-api-docs.git
Step 3: Stage Files
git add .
Step 4: Commit
git commit -m "Initial commit: Add XUI.ONE API documentation with authentication section"
Step 5: Set Branch
git branch -M main
Step 6: Push to GitHub
git push -u origin main
Note: You'll be prompted for GitHub credentials.
Authentication Options
Option 1: Personal Access Token (Recommended)
-
Generate Token:
- Go to GitHub: Settings → Developer settings → Personal access tokens → Tokens (classic)
- Click "Generate new token (classic)"
- Select scopes:
repo(Full control of private repositories) - Generate and copy the token
-
Use Token:
- When prompted for password, paste your token instead
Option 2: GitHub CLI
# Install GitHub CLI
# macOS
brew install gh
# Linux
sudo apt install gh
# Windows
winget install --id GitHub.cli
# Authenticate
gh auth login
# Push repository
git push -u origin main
Option 3: SSH Key
- Generate SSH Key:
ssh-keygen -t ed25519 -C "your_email@example.com"
-
Add to GitHub:
- Copy public key:
cat ~/.ssh/id_ed25519.pub - Go to GitHub: Settings → SSH and GPG keys → New SSH key
- Paste and save
- Copy public key:
-
Change Remote URL:
git remote set-url origin git@github.com:worldofiptvcom/xui-one-api-docs.git
- Push:
git push -u origin main
Deploy to GitHub Pages
After uploading to GitHub, deploy the documentation website:
Step 1: Enable GitHub Pages
- Go to your repository on GitHub
- Click Settings tab
- Scroll to Pages section (left sidebar)
- Under Source:
- Branch:
main - Folder:
/ (root)
- Branch:
- Click Save
Step 2: Wait for Deployment
- GitHub will build your site (takes 1-2 minutes)
- Check the Actions tab to see deployment progress
Step 3: Access Your Documentation
Your documentation will be available at:
https://worldofiptvcom.github.io/xui-one-api-docs/
Open index.html to view the interactive Swagger UI documentation.
Custom Domain (Optional)
- Add CNAME file:
echo "docs.yoursite.com" > CNAME
git add CNAME
git commit -m "Add custom domain"
git push
-
Configure DNS:
- Add CNAME record:
docs.yoursite.com→worldofiptvcom.github.io
- Add CNAME record:
-
Update GitHub Pages:
- Settings → Pages → Custom domain
- Enter:
docs.yoursite.com - Save
Alternative Hosting
Netlify
-
Connect Repository:
- Go to https://netlify.com
- New site from Git
- Select your GitHub repository
-
Build Settings:
- Build command: (leave empty)
- Publish directory:
/
-
Deploy:
- Click Deploy Site
- Done! Your site is live
Vercel
-
Import Project:
- Go to https://vercel.com
- Import Git Repository
- Select your repository
-
Deploy:
- Click Deploy
- Done! Your site is live
GitLab Pages
- Create
.gitlab-ci.yml:
pages:
stage: deploy
script:
- mkdir .public
- cp -r * .public
- mv .public public
artifacts:
paths:
- public
only:
- main
- Push to GitLab:
git remote add gitlab https://gitlab.com/yourusername/xui-one-api-docs.git
git push gitlab main
Self-Hosted
- Copy Files to Web Server:
scp -r xui-one-api-docs/* user@your-server.com:/var/www/html/docs/
- Configure Nginx:
server {
listen 80;
server_name docs.yoursite.com;
root /var/www/html/docs;
index index.html;
location / {
try_files $uri $uri/ =404;
}
}
- Restart Nginx:
sudo systemctl restart nginx
Updating Documentation
When you make changes:
# Stage changes
git add .
# Commit
git commit -m "Update: Add Streams API documentation"
# Push
git push origin main
GitHub Pages will automatically rebuild and deploy.
Troubleshooting
"Permission Denied" Error
Solution:
- Use Personal Access Token instead of password
- Or set up SSH key authentication
"Repository Not Found" Error
Solution:
- Verify repository URL:
git remote -v - Ensure repository exists on GitHub
- Check you have access rights
GitHub Pages Not Working
Solution:
- Verify Pages is enabled in repository settings
- Check Actions tab for deployment status
- Ensure
index.htmlexists in repository root - Wait a few minutes for initial deployment
Changes Not Appearing
Solution:
- Clear browser cache
- Wait 1-2 minutes for GitHub Pages rebuild
- Check if git push was successful
Viewing Locally
Before deploying, test locally:
# Using Python
python3 -m http.server 8000
# Using Node.js
npx http-server
# Using PHP
php -S localhost:8000
Then open: http://localhost:8000/index.html
Support
- GitHub Issues: Report deployment problems
- GitHub Discussions: Ask deployment questions
- World of IPTV: Community support
Need help? Open an issue on GitHub with:
- What you tried
- Error messages
- Your operating system
- Screenshots if applicable