Files
xui-one-api-docs/DEPLOYMENT.md
T
2025-12-12 15:07:46 +03:00

6.1 KiB

Deployment Guide

This guide explains how to upload the documentation to GitHub and deploy it online.

Table of Contents

  1. Automatic Upload (Recommended)
  2. Manual Upload
  3. Deploy to GitHub Pages
  4. Alternative Hosting

Prerequisites

  • Git installed on your system
  • GitHub account credentials or Personal Access Token

Steps

  1. Navigate to the project directory:
cd /path/to/xui-one-api-docs
  1. Run the upload script:
./upload-to-github.sh
  1. Follow the prompts:

    • Enter commit message (or press Enter for default)
    • Provide GitHub credentials when prompted
  2. 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

  1. 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
  2. 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

  1. Generate SSH Key:
ssh-keygen -t ed25519 -C "your_email@example.com"
  1. 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
  2. Change Remote URL:

git remote set-url origin git@github.com:worldofiptvcom/xui-one-api-docs.git
  1. Push:
git push -u origin main

Deploy to GitHub Pages

After uploading to GitHub, deploy the documentation website:

Step 1: Enable GitHub Pages

  1. Go to your repository on GitHub
  2. Click Settings tab
  3. Scroll to Pages section (left sidebar)
  4. Under Source:
    • Branch: main
    • Folder: / (root)
  5. 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)

  1. Add CNAME file:
echo "docs.yoursite.com" > CNAME
git add CNAME
git commit -m "Add custom domain"
git push
  1. Configure DNS:

    • Add CNAME record: docs.yoursite.comworldofiptvcom.github.io
  2. Update GitHub Pages:

    • Settings → Pages → Custom domain
    • Enter: docs.yoursite.com
    • Save

Alternative Hosting

Netlify

  1. Connect Repository:

  2. Build Settings:

    • Build command: (leave empty)
    • Publish directory: /
  3. Deploy:

    • Click Deploy Site
    • Done! Your site is live

Vercel

  1. Import Project:

  2. Deploy:

    • Click Deploy
    • Done! Your site is live

GitLab Pages

  1. Create .gitlab-ci.yml:
pages:
  stage: deploy
  script:
    - mkdir .public
    - cp -r * .public
    - mv .public public
  artifacts:
    paths:
      - public
  only:
    - main
  1. Push to GitLab:
git remote add gitlab https://gitlab.com/yourusername/xui-one-api-docs.git
git push gitlab main

Self-Hosted

  1. Copy Files to Web Server:
scp -r xui-one-api-docs/* user@your-server.com:/var/www/html/docs/
  1. Configure Nginx:
server {
    listen 80;
    server_name docs.yoursite.com;
    root /var/www/html/docs;
    index index.html;

    location / {
        try_files $uri $uri/ =404;
    }
}
  1. 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.html exists 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