Merge pull request #21 from ShivRaiGithub/login_voting_result_db #58
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: Python Application | |
on: [push] | |
jobs: | |
run-python: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.x' # Change to your preferred Python version, e.g., '3.9' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r src/requirements.txt | |
- name: Set environment variables | |
run: | | |
echo "FLASK_APP=src/app.py" >> $GITHUB_ENV | |
echo "FLASK_ENV=development" >> $GITHUB_ENV | |
- name: Run Flask application | |
run: | | |
pip install gunicorn # Install gunicorn for production-ready server | |
gunicorn --bind 0.0.0.0:5000 src.app:app & |