Files
dealplustech/GITEA_DEPLOYMENT.md
Kunthawat Greethong 45961b8d76 refactor: Move Astro project to root directory
- Move all Astro files from dealplustech-astro/ to root
- Archive Next.js code in _nextjs-backup/
- Update .gitignore for Astro project
- Simplify project structure

This completes the migration from Next.js to Astro.
The Astro project is now at the root level.
2026-03-03 10:21:42 +07:00

5.5 KiB

🚀 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

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:

# 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:

# Make changes
git add .
git commit -m "Update something"
git push

# Easypanel automatically rebuilds! 🎉

Manual Redeploy

./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

URL: http://110.164.146.46:3001
Owner: dealplustech
Repo: dealplustech-astro
Branch: main

Build Settings

Build Command: npm run build
Publish Directory: dist/
Node Version: 20 (from .nvmrc or package.json)

Environment Variables

Add in Easypanel service settings:

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:

# 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