Skip to content

Livelo Promoções Bot #6

Livelo Promoções Bot

Livelo Promoções Bot #6

Workflow file for this run

name: Livelo Promoções Bot
on:
# Roda automaticamente todos os dias às 08:00 UTC (05:00 BRT)
schedule:
- cron: '0 8 * * *'
# Permite execução manual via GitHub Actions interface
workflow_dispatch:
inputs:
run_now:
description: 'Executar agora'
required: false
default: 'true'
jobs:
scrape-promocoes:
runs-on: ubuntu-latest
steps:
- name: Checkout código
uses: actions/checkout@v4
- name: Setup Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'pip'
- name: Instalar dependências Python
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Instalar browsers Playwright
run: |
python -m playwright install chromium
python -m playwright install-deps chromium
- name: Criar arquivo .env com secrets
run: |
echo "LIVELO_CPF=${{ secrets.LIVELO_CPF }}" >> .env
echo "LIVELO_PASSWORD=${{ secrets.LIVELO_PASSWORD }}" >> .env
echo "N8N_WEBHOOK_URL=${{ secrets.N8N_WEBHOOK_URL }}" >> .env
- name: Executar bot de promoções
run: |
python -m pytest main.py::test_buscar_promocoes_livelo -v -s --tb=short
- name: Upload logs em caso de erro
if: failure()
uses: actions/upload-artifact@v4
with:
name: debug-logs
path: |
debug_page.html
.pytest_cache/
retention-days: 7