Skip to content

Update main.yml

Update main.yml #2

Workflow file for this run

name: Auto-Deploy Flask App
on:
push:
branches:
- main
jobs:
deploy:
runs-on: [self-hosted]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Stop Existing Flask App
run: pkill -f "python app.py" || true
- name: Start Flask App
run: |
nohup python app.py &
- name: Output Deployment URL
run: echo "App deployed at http://85.209.135.93:5000" | tee url.txt
- name: Upload Deployment Summary
uses: actions/upload-artifact@v4
with:
name: deployment-url
path: url.txt