Skip to content

Added test database connection script #7

Added test database connection script

Added test database connection script #7

Workflow file for this run

name: Deploy to Render
on:
push:
branches:
- main # Substitua 'main' pela sua branch principal, se diferente
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.11' # Substitua pela versão do Python que você está usando
- name: Install dependencies
run: |
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
- name: Test database connection
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
run: |
source venv/bin/activate
python test_db_connection.py
- name: Make retry.sh executable
run: chmod +x retry.sh
- name: Run migrations
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }} # Certifique-se de adicionar esta variável nos segredos do GitHub
SECRET_KEY: ${{ secrets.SECRET_KEY }}
EMAIL_HOST: ${{ secrets.EMAIL_HOST }}
EMAIL_PORT: ${{ secrets.EMAIL_PORT }}
EMAIL_HOST_USER: ${{ secrets.EMAIL_HOST_USER }}
EMAIL_HOST_PASSWORD: ${{ secrets.EMAIL_HOST_PASSWORD }}
DEFAULT_FROM_EMAIL: ${{ secrets.DEFAULT_FROM_EMAIL }}
CLOUDINARY_CLOUD_NAME: ${{ secrets.CLOUDINARY_CLOUD_NAME }}
CLOUDINARY_API_KEY: ${{ secrets.CLOUDINARY_API_KEY }}
CLOUDINARY_API_SECRET: ${{ secrets.CLOUDINARY_API_SECRET }}
run: |
source venv/bin/activate
./retry.sh
- name: Trigger Render Deploy
env:
RENDER_DEPLOY_HOOK: ${{ secrets.RENDER_DEPLOY_HOOK }} # Usando o segredo do hook de deploy
run: |
curl -X POST "$RENDER_DEPLOY_HOOK"