# πŸš€ Gitea Repository Deployment - BEST METHOD! ## βœ… Why This is Better | Method | Docker Registry | Gitea Repo | |--------|----------------|------------| | Build locally | βœ… Required | ❌ Not needed | | Push to registry | βœ… Required | ❌ Not needed | | Easypanel builds | ❌ No | βœ… Yes! | | Auto-deploy on push | ❌ No | βœ… Yes! | | Version control | ❌ No | βœ… Yes! | | Rollbacks | ❌ Hard | βœ… Easy | --- ## 🎯 How It Works ``` β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ You Git β”‚ β”‚ Easypanel β”‚ β”‚ Deployed β”‚ β”‚ Push │────▢│ Clones & │────▢│ Service β”‚ β”‚ to Gitea β”‚ β”‚ Builds β”‚ β”‚ Running β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ ``` **Easypanel will:** 1. Clone your Gitea repository 2. Run `npm install` 3. Run `npm run build` 4. Deploy the `dist/` folder 5. Serve on port 4321 --- ## πŸ“‹ Setup Steps ### Step 1: Run Deploy Script ```bash cd dealplustech-astro ./skills/easypanel-deploy/deploy.sh deploy ``` **It will show:** ``` Gitea URL: http://110.164.146.46:3001 Repository: dealplustech/dealplustech-astro Branch: main Build Command: npm run build Publish Directory: dist Port: 4321 ``` ### Step 2: Create Service in Easypanel ``` 1. Open: http://110.164.146.46:3000 2. Select Project: customerwebsite 3. Click: New Service β†’ Git Repository 4. Configure: β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Repository URL: β”‚ β”‚ http://110.164.146.46:3001/ β”‚ β”‚ dealplustech/dealplustech-astro β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Branch: main β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Build Command: npm run build β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Publish Directory: dist β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Port: 4321 β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ 5. Click: Deploy ``` ### Step 3: Wait for Build Easypanel will: - βœ… Clone from Gitea (~10 seconds) - βœ… Run `npm install` (~30 seconds) - βœ… Run `npm run build` (~20 seconds) - βœ… Deploy `dist/` (~5 seconds) **Total: ~1 minute** ### Step 4: Register Service ID After deployment completes: ```bash # Copy Service ID from Easypanel dashboard ./skills/easypanel-deploy/deploy.sh register svc_xxx... ``` --- ## πŸ”„ Automatic Updates ### Enable Auto-Deploy **In Easypanel:** 1. Go to service settings 2. Click: Git β†’ Auto Deploy 3. Enable: Auto Deploy on Push **Then:** ```bash # Make changes git add . git commit -m "Update something" git push # Easypanel automatically rebuilds! πŸŽ‰ ``` ### Manual Redeploy ```bash ./skills/easypanel-deploy/deploy.sh redeploy ``` --- ## βœ… Benefits ### 1. No Docker Registry - ❌ No `docker build` - ❌ No `docker push` - ❌ No registry credentials ### 2. Automatic Deployments - βœ… Push to Gitea - βœ… Easypanel rebuilds - βœ… Zero manual steps ### 3. Version Control - βœ… Every commit = potential deployment - βœ… Easy rollbacks - βœ… Change history ### 4. Build Caching - βœ… `node_modules` cached - βœ… Faster builds - βœ… Efficient --- ## πŸ”§ Configuration ### Gitea Repository ```bash URL: http://110.164.146.46:3001 Owner: dealplustech Repo: dealplustech-astro Branch: main ``` ### Build Settings ```bash Build Command: npm run build Publish Directory: dist/ Node Version: 20 (from .nvmrc or package.json) ``` ### Environment Variables Add in Easypanel service settings: ```bash NODE_ENV=production NEXT_PUBLIC_SITE_URL=https://your-domain.com ``` --- ## πŸ“ Required Files Your repository should have: ``` dealplustech-astro/ β”œβ”€β”€ package.json βœ… Required (defines build) β”œβ”€β”€ Dockerfile ⚠️ Optional (for Docker mode) β”œβ”€β”€ astro.config.mjs βœ… Required β”œβ”€β”€ src/ βœ… Required └── .gitignore βœ… Required ``` --- ## 🎯 Next Action **Deploy now:** ```bash # 1. Run deployment script ./skills/easypanel-deploy/deploy.sh deploy # 2. Follow instructions to create service in Easypanel # 3. After deployment: ./skills/easypanel-deploy/deploy.sh register SERVICE_ID # 4. Enable auto-deploy in Easypanel # 5. Future updates: just git push! ``` --- **This is THE BEST way to deploy!** πŸŽ‰ - No Docker needed - No registry needed - Automatic deployments - Full version control