Skip to content

ETL Pipeline

ETL Pipeline #59

Workflow file for this run

name: ETL Pipeline
on:
schedule:
- cron: "0 2 * * *"
workflow_dispatch:
inputs:
job:
description: "ETL job to run"
required: true
default: "all"
type: choice
options:
- all
- import
- aggregate
- cleanup
jobs:
etl:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"
- name: Install dependencies
working-directory: ./etl
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run ETL jobs
working-directory: ./etl
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
EXTERNAL_API_KEY: ${{ secrets.EXTERNAL_API_KEY }}
run: |
if [ "${{ github.event.inputs.job }}" = "all" ] || [ "${{ github.event.inputs.job }}" = "" ]; then
python runner.py once
else
python runner.py ${{ github.event.inputs.job }}
fi
- name: Upload ETL logs
if: always()
uses: actions/upload-artifact@v3
with:
name: etl-logs
path: etl/logs/
retention-days: 7