Actualizador de Microdatos #195
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: Actualizador de Microdatos | |
on: | |
schedule: | |
- cron: '0 8 * * *' # Ejecuta a las 8:00 AM UTC todos los días | |
workflow_dispatch: | |
jobs: | |
actualizar-datos: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Configurar Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.8' | |
- name: Instalar dependencias | |
run: | | |
python -m pip install --upgrade pip | |
pip install requests | |
- name: Ejecutar el script de actualización | |
run: python ./actualizador.py | |
- name: Limpiar directorios vacíos | |
run: find ./microdatos -type d -empty -delete | |
- name: Send repository dispatch event to encuestador-de-hogares | |
if: success() # Only trigger if the update was successful | |
run: | | |
curl -X POST \ | |
-H "Accept: application/vnd.github.v3+json" \ | |
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | |
https://api.github.com/repos/matuteiglesias/encuestador-de-hogares/dispatches \ | |
-d '{"event_type":"microdata-updated"}' | |