Skip to content

Update deploy.yml

Update deploy.yml #2

Workflow file for this run

name: UptimeMonitor CI/CD
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Create virtual environment and install dependencies
run: |
python -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
- name: Check if app starts
env:
FLASK_APP: app.py
FLASK_ENV: development
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
run: |
source venv/bin/activate
python -c '
import subprocess

Check failure on line 39 in .github/workflows/deploy.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/deploy.yml

Invalid workflow file

You have an error in your yaml syntax on line 39
import time
import requests
# Запускаем Flask в фоне
server = subprocess.Popen(["python", "app.py"])
time.sleep(5) # Ждём старта сервера
# Проверяем доступность /
try:
response = requests.get("http://localhost:5000")
assert response.status_code == 200, f"App failed to start: {response.status_code}"
print("✅ App is running and responding!")
except Exception as e:
print(f"❌ Error: {e}")
exit(1)
finally:
server.terminate()
'