Files
AyposWeb/deploy.sh
Server 7c70e03d5e CI/CD
2025-07-15 03:35:15 +00:00

25 lines
720 B
Bash

#!/bin/bash
APP_DIR="/home/ubuntu/AyposWeb"
# Navigate to your app directory
cd "$APP_DIR" || { echo "Failed to cd to $APP_DIR"; exit 1; }
# Pull latest changes from Gitea
echo "Pulling latest code..."
git pull origin main || { echo "Git pull failed"; exit 1; }
# Build your app (change this to your build command)
# For example, npm build:
echo "Installing dependencies..."
npm install || { echo "npm install failed"; exit 1; }
echo "Building app..."
npm run build || { echo "npm build failed"; exit 1; }
# Restart your app (change this to your app's restart command)
# For example, systemctl restart myapp.service:
systemctl reload nginx || { echo "Failed to reload nginx"; exit 1; }
echo "Deployment complete"