Create manual.yml #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run main.py | ||
on: push: | ||
branches: - main # или замените на вашу основную ветку | ||
jobs: | ||
run-main: | ||
runs-on: ubuntu-latest | ||
steps: - name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- name: Set up Python uses: actions/setup-python@v2 | ||
with: python-version: 3.x # Укажите версию Python, которую вы хотите использовать | ||
- name: Install dependencies | ||
run: | python -m pip install --upgrade pip | ||
pip install -r requirements.txt # Убедитесь, что у вас есть файл с зависимостями | ||
- name: Run main.py run: | | ||
nohup python main.py & # Запустите main.py в фоновом режиме echo $! > pid.txt # Сохраните PID процесса в файл pid.txt | ||
- name: Keep the workflow running | ||
run: | while kill -0 $(cat pid.txt); do | ||
sleep 10 done |