refresh #4
This file contains hidden or 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: refresh | |
| on: | |
| schedule: | |
| - cron: '0 6 * * 1' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| issues: write | |
| jobs: | |
| refresh: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Instalar dependencias | |
| run: pip install -r requirements.txt | |
| - name: Refresh estable (ISTAC, SITCAN, WFS) | |
| run: make population employment renta urbanismo geografia poblacion_secciones | |
| - name: Refresh económico (empresas, autónomos) | |
| run: make empresas autonomos | |
| - name: Refresh movilidad | |
| run: make atestados gtfs sitycleta gtfs_stops | |
| - name: Refresh turismo | |
| run: make tourism | |
| - name: Validar datasets | |
| run: make validate | |
| - name: Resumen | |
| run: make status | |
| - name: Commit cambios | |
| run: | | |
| git config user.name "github-actions" | |
| git config user.email "actions@github.com" | |
| git add -A | |
| git diff --staged --quiet || git commit -m "chore: refresh $(date +%Y-%m-%d)" | |
| git push | |
| - name: Notificar fallo | |
| if: failure() | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| github.rest.issues.create({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| title: '⚠️ Refresh fallido ' + new Date().toISOString().slice(0,10), | |
| body: 'Revisar: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}' | |
| }) |