ci: add deploy script and simplify CI/CD workflow
Some checks failed
Deploy to Production / Deploy to 192.168.1.190 (push) Has been cancelled

- scripts/deploy.sh: automated deployment with interactive env setup
  (--env-only, --build, --full)
- Supports OpenRouter, OpenAI, Ollama, DeepSeek providers
- Auto-generates NEXTAUTH_SECRET and postgres password
- Waits for healthchecks, initializes DB, shows status
- CI/CD workflow simplified to call deploy.sh --build

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Sepehr Ramezani
2026-04-21 22:55:15 +02:00
parent 106dac9ca4
commit f3b58b32fd
2 changed files with 299 additions and 23 deletions

View File

@@ -17,27 +17,8 @@ jobs:
username: ${{ secrets.DEPLOY_USER }}
key: ${{ secrets.DEPLOY_SSH_KEY }}
port: ${{ secrets.DEPLOY_PORT || 22 }}
script_stop: true
command_timeout: 10m
script: |
set -e
echo "=== Memento Deploy ==="
echo "Branch: ${{ gitea.ref }}"
# Go to project directory
cd ${{ secrets.DEPLOY_PATH }}/Momento
# Pull latest code
git pull origin main
# Build and restart containers
docker compose build --parallel
docker compose up -d
# Wait for healthchecks
echo "Waiting for containers to be healthy..."
sleep 10
# Check status
docker compose ps
echo "=== Deploy complete ==="
cd ${{ secrets.DEPLOY_PATH }}
bash scripts/deploy.sh --build