name: Deploy Startover on: push: branches: - main jobs: deploy: runs-on: ubuntu-latest env: DOCKER_BUILDKIT: 1 COMPOSE_DOCKER_CLI_BUILD: 1 steps: - name: Pull latest code run: | cd /home/three/startover/repo git fetch origin git reset --hard origin/main echo "Current commit: $(git log --oneline -1)" - name: Copy environment file run: | cp /home/three/startover/.env.production /home/three/startover/repo/.env.production - name: Build and Deploy run: | cd /home/three/startover/repo docker compose -f docker-compose.prod.yml --env-file .env.production up -d --build --remove-orphans - name: Wait for services run: sleep 15 - name: Health check run: | if curl -sf http://localhost/health > /dev/null 2>&1; then echo "Health check PASSED" else echo "WARNING: Health check pending" fi - name: Cleanup old images run: docker image prune -f