Skip to content

Commit 1993d8c

Browse files
Update estrutura.yml
1 parent 8ba2971 commit 1993d8c

1 file changed

Lines changed: 19 additions & 30 deletions

File tree

.github/workflows/estrutura.yml

Lines changed: 19 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,27 @@
11
name: Estrutura ANAC
2-
32
on:
4-
workflow_dispatch:
3+
workflow_dispatch: {}
4+
push:
5+
paths:
6+
- .github/workflows/estrutura.yml
57
schedule:
6-
- cron: '0 0 1 * *'
7-
8+
- cron: 0 3-6 * * 0-6
89
jobs:
9-
estrutura:
10+
schedule:
1011
runs-on: ubuntu-latest
11-
1212
steps:
13-
- name: Verificar repositório
13+
- name: Setup deno
14+
uses: denoland/setup-deno@main
15+
with:
16+
deno-version: v1.x
17+
- name: Check out repo
1418
uses: actions/checkout@v4
15-
16-
- name: Configurar python
17-
uses: actions/setup-python@v4
19+
20+
# URL dos dados a serem baixados (http_url) e on nomes dos arquivos (downloaded_filename)
21+
- name: Fetch data
22+
uses: githubocto/flat@v3
1823
with:
19-
python-version: '3.9'
20-
21-
- name: Instalar dependências
22-
run: |
23-
python -m pip install --upgrade pip
24-
pip install aiohttp pandas jinja2 xmltodict requests
25-
26-
- name: Rodar o script
27-
run: |
28-
python scripts/estrutura.py
29-
30-
- name: Commit e push de arquivos, se houver mudanças
31-
run: |
32-
git config user.name github-actions
33-
git config user.email [email protected]
34-
git add :/
35-
COMMIT_MESSAGE="$(date +"%Y-%m-%d %H:%M")"
36-
git commit -m "$COMMIT_MESSAGE" || exit 0
37-
git pull --rebase
38-
git push
24+
http_url: https://estruturaorganizacional.dados.gov.br/doc/estrutura-organizacional/completa.json?codigoPoder=1&codigoEsfera=1&codigoUnidade=86144&retornarOrgaoEntidadeVinculados=SIM
25+
downloaded_filename: anac/estrutura.json
26+
27+

0 commit comments

Comments
 (0)