Files
bini-shorts-maker/deploy.sh
kihong.kim 4aa282c11a
Some checks failed
Deploy to Server / deploy (push) Failing after 16m58s
Remove --no-cache from docker build to cache Whisper model
Docker layer caching will now preserve the Whisper model download step,
avoiding 1.5GB download on every deployment.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 20:38:19 +09:00

44 lines
1.0 KiB
Bash

#!/bin/bash
# Auto-deployment script for shorts-maker
# This script is triggered by Gitea webhook on push
set -e
# Configuration
APP_DIR="/home/bini/project/bini-shorts-maker"
LOG_FILE="/var/log/shorts-maker-deploy.log"
COMPOSE_FILE="docker-compose.yml"
# Logging function
log() {
echo "[$(date '+%Y-%m-%d %H:%M:%S')] $1" | tee -a "$LOG_FILE"
}
log "=== Deployment started ==="
# Navigate to app directory
cd "$APP_DIR" || { log "ERROR: Cannot cd to $APP_DIR"; exit 1; }
# Pull latest code
log "Pulling latest code from git..."
git fetch origin
git reset --hard origin/main
log "Git pull completed"
# Rebuild and restart containers
log "Rebuilding Docker containers..."
docker compose -f "$COMPOSE_FILE" build
log "Restarting containers..."
docker compose -f "$COMPOSE_FILE" down
docker compose -f "$COMPOSE_FILE" up -d
# Clean up old images
log "Cleaning up old Docker images..."
docker image prune -f
log "=== Deployment completed successfully ==="
# Show running containers
docker compose -f "$COMPOSE_FILE" ps