Update deploy params
Deploy Frontend / build-and-deploy (push) Failing after 1s Details

This commit is contained in:
romanskijdev 2026-06-18 12:45:22 +03:00
parent 4af9b38375
commit c762af3360
1 changed files with 17 additions and 10 deletions

View File

@ -7,7 +7,7 @@ on:
env:
REPO_DIR: "/workspace/ruspet_admin_frontend"
REPO_URL: "https://72.56.235.246.nip.io/gitea/romanskijdev/admin_ruspet.git"
BUILD_DIR: "/var/www/admin.ruspet.local"
BUILD_DIR: "/var/www/admin.ruspet.tw1.ru"
jobs:
build-and-deploy:
@ -24,6 +24,7 @@ jobs:
echo "Commit: ${{ github.sha }}"
echo "Author: ${{ github.actor }}"
echo "Time: $(date '+%Y-%m-%d %H:%M:%S')"
echo "Runner: $(hostname)"
echo "════════════════════════════════════════"
- name: 📦 Checkout
@ -38,6 +39,16 @@ jobs:
git clone "$REPO_URL" "$REPO_DIR"
fi
- name: 💾 Cache node_modules
uses: actions/cache@v3
with:
path: |
~/.npm
$REPO_DIR/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: 📥 Install dependencies
run: |
cd "$REPO_DIR"
@ -53,20 +64,11 @@ jobs:
- name: 📤 Deploy to web server
run: |
echo "📤 Deploying to $BUILD_DIR..."
# Создаем директорию если не существует
sudo mkdir -p "$BUILD_DIR"
# Очищаем старую версию
sudo rm -rf "$BUILD_DIR"/*
# Копируем новую сборку
sudo cp -r "$REPO_DIR/dist/"* "$BUILD_DIR/"
# Устанавливаем правильные права
sudo chown -R www-data:www-data "$BUILD_DIR"
sudo chmod -R 755 "$BUILD_DIR"
echo "✅ Frontend deployed successfully"
- name: ✅ Verify deployment
@ -74,6 +76,7 @@ jobs:
echo "🔍 Verifying deployment..."
if [ -f "$BUILD_DIR/index.html" ]; then
echo "✅ index.html exists"
ls -lh "$BUILD_DIR/index.html"
echo "✅ Deployment verified successfully"
else
echo "❌ index.html not found"
@ -87,10 +90,14 @@ jobs:
echo "📊 DEPLOYMENT SUMMARY"
echo "════════════════════════════════════════"
echo "Status: ${{ job.status }}"
echo "Branch: ${{ github.ref }}"
echo "Commit: ${{ github.sha }}"
echo "Duration: $SECONDS seconds"
echo "════════════════════════════════════════"
if [ "${{ job.status }}" == "success" ]; then
echo "✅ Frontend deployment completed!"
echo "🌐 Available at: https://admin.ruspet.tw1.ru"
else
echo "❌ Frontend deployment failed!"
fi