Skip to content

feat(mongo-import): Importa ocorrências #1

feat(mongo-import): Importa ocorrências

feat(mongo-import): Importa ocorrências #1

name: Update MongoDB - Flora
on:
push:
branches: ['main']
paths:
[
'src/lib/**',
'src/flora.ts',
'.github/workflows/update-mongodb-flora.yml'
]
workflow_dispatch:
env:
DWCA_URL: https://ipt.jbrj.gov.br/jbrj/archive.do?r=lista_especies_flora_brasil
jobs:
update-db:
permissions:
contents: 'read'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- name: Install zip
run: sudo apt update && sudo apt install zip
- name: Update DB from web
if: ${{ github.event.inputs.DWCA_URL }}
env:
MONGO_URI: ${{ secrets.MONGO_URI }}
TEMPDIR: /home/runner/work/DarwinCoreJSON/
run: deno run -A src/flora.ts "${{ github.event.inputs.DWCA_URL}}"
- name: Update DB
if: ${{ !github.event.inputs.DWCA_URL }}
env:
MONGO_URI: ${{ secrets.MONGO_URI }}
TEMPDIR: /home/runner/work/DarwinCoreJSON/
run: deno run -A src/flora.ts "${{ env.DWCA_URL }}"