Files
GenExam-IA/.gitlab-ci.yml
T
Mireya Cueto Garrido 7f32380e0a Adapt CI/CD and endpoint defaults for Sinbad2 production.
Configure GitLab deploy pipeline for this app and switch backend/frontend endpoint defaults from localhost to sinbad2.ujaen.es, including Docker, env files, API client, CORS, and docs.
2026-06-02 10:25:53 +02:00

38 lines
987 B
YAML

stages:
- deploy
variables:
APP_NAME: "generadorexamenesllms"
BACKEND_PORT: "8074"
FRONTEND_PORT: "8075"
deploy_to_sinbad2:
stage: deploy
before_script:
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- ssh-keyscan $SSH_HOST >> ~/.ssh/known_hosts
script:
- echo "Enviando código a Sinbad2..."
- ssh $REMOTE_USER@$SSH_HOST "mkdir -p ~/deploy_$APP_NAME"
- scp -r ./* $REMOTE_USER@$SSH_HOST:~/deploy_$APP_NAME/
- echo "Levantando contenedores con Docker Compose..."
- ssh $REMOTE_USER@$SSH_HOST "
cd ~/deploy_$APP_NAME &&
docker compose down --remove-orphans &&
docker compose build --no-cache frontend backend &&
docker compose up -d
"
- echo "Despliegue completado."
- echo "Backend -> http://sinbad2.ujaen.es:$BACKEND_PORT"
- echo "Frontend -> http://sinbad2.ujaen.es:$FRONTEND_PORT"
only:
- branches