Skip to content

Update tecdottir database #95109

Update tecdottir database

Update tecdottir database #95109

name: Update tecdottir database
on:
schedule:
- cron: '14/10 * * * *' # runs every 10min
workflow_dispatch:
jobs:
update_data:
runs-on: ubuntu-latest
timeout-minutes: 45
environment: production
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Install heroku-cli
run: curl https://cli-assets.heroku.com/install-ubuntu.sh | sh
- uses: akhileshns/[email protected]
with:
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
heroku_email: ${{secrets.HEROKU_EMAIL}}
justlogin: true
- name: Get DATABASE_URL
id: db
run: |
heroku ps -a tecdottir
echo "::set-output name=db_url::$(heroku config:get DATABASE_URL -a tecdottir)"
- name: Download CSVs
run: ./download_csvs.sh
- name: Import CSVs to database
env:
DATABASE_URL: ${{steps.db.outputs.db_url}}
run: ./import_csvs.sh