diff --git a/.forgejo/workflows/deploy.yaml b/.forgejo/workflows/deploy.yaml index 2768ea1..bde0e53 100644 --- a/.forgejo/workflows/deploy.yaml +++ b/.forgejo/workflows/deploy.yaml @@ -286,14 +286,17 @@ jobs: needs: ensure-nginx-running if: always() && needs.ensure-nginx-running.result == 'success' steps: - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: '20' - - - name: Install Dependencies + - name: Install System Dependencies run: | - apt-get update && apt-get install -y rsync openssh-client jq git nodejs npm + apt-get update && apt-get install -y rsync openssh-client jq git curl wget gnupg2 software-properties-common ca-certificates + + - name: Setup Node.js + run: | + # Install Node.js manually in container + curl -fsSL https://deb.nodesource.com/setup_20.x | bash - + apt-get install -y nodejs + echo "Node.js version: $(node --version)" + echo "NPM version: $(npm --version)" - name: Setup SSH run: | @@ -341,6 +344,8 @@ jobs: - name: Build Web App working-directory: mnemo_cards_web_v2 run: | + which flutter || echo "Flutter not found in PATH" + flutter --version || echo "Flutter command failed" flutter pub get flutter build web --release \ --dart-define=API_BASE_URL=https://api.mnemo-cards.online \ @@ -400,4 +405,54 @@ jobs: exit 1 fi fi - ENDSSH \ No newline at end of file + ENDSSH + + final-verification: + name: Final Verification + runs-on: ubuntu-latest + needs: [deploy-backend, deploy-web] + if: always() + steps: + - name: Wait and Verify All Services + run: | + echo "⏳ Ждем завершения всех операций..." + sleep 10 + + echo "🔍 Финальная проверка доступности всех сайтов..." + ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} << 'ENDSSH' + set -e + echo "📊 Статус всех сервисов:" + + # Проверяем nginx + if sudo systemctl is-active --quiet nginx; then + echo "✅ nginx: работает" + else + echo "❌ nginx: НЕ работает!" + sudo systemctl status nginx --no-pager || true + fi + + # Проверяем backend + if sudo systemctl is-active --quiet mnemo_cards_server; then + echo "✅ backend: работает" + else + echo "❌ backend: НЕ работает!" + sudo systemctl status mnemo_cards_server --no-pager || true + fi + + echo "" + echo "🌐 Тестируем доступность сайтов:" + + # Тестируем все сайты + sites=("https://mnemo-cards.online/" "https://api.mnemo-cards.online/" "https://code.mnemo-cards.online/" "https://vscode.mnemo-cards.online/") + for site in "${sites[@]}"; do + if curl -I --max-time 10 "$site" 2>/dev/null | grep -q "200\|301\|302"; then + echo "✅ $site доступен" + else + echo "❌ $site НЕДОСТУПЕН!" + curl -I --max-time 5 "$site" || true + fi + done + + echo "" + echo "🎉 Проверка завершена!" + ENDSSH