Skip to content

Update MongoDB - Flora #53

Update MongoDB - Flora

Update MongoDB - Flora #53

name: Update MongoDB - Flora
on:
push:
branches: ['main']
paths:
[
'src/lib/**',
'src/flora.ts',
'.github/workflows/update-mongodb-flora.yml'
]
workflow_dispatch:
schedule:
- cron: '0 2 * * 0'
env:
DWCA_URL: https://ipt.jbrj.gov.br/jbrj/archive.do?r=florafunga
jobs:
update-db:
permissions:
contents: 'read'
runs-on: [self-hosted]
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 }}"