-
Notifications
You must be signed in to change notification settings - Fork 1
47 lines (42 loc) · 1.56 KB
/
etl.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Import scraped data to configured database
on:
workflow_dispatch:
repository_dispatch:
types: [nightly-scrape-done]
jobs:
import_filings:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: "deploy"
- name: Import candidate, PAC, and filing data
run: |
touch .env
docker compose -f docker-compose.etl.yml run --rm \
-e AWS_STORAGE_BUCKET_NAME=${{ secrets.AWS_STORAGE_BUCKET_NAME }} \
-e AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} \
-e AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} \
-e DATABASE_URL=${{ secrets.DATABASE_URL }} \
app make import/candidates import/pacs import/candidate_filings import/pac_filings
import_transactions:
runs-on: ubuntu-latest
needs: import_filings
strategy:
matrix:
transaction_type: [CON, EXP]
year: [2023, 2024]
quarter: [1, 2, 3, 4]
steps:
- uses: actions/checkout@v3
with:
ref: "deploy"
- name: Import transaction data
run: |
touch .env
docker compose -f docker-compose.etl.yml run --rm \
-e AWS_STORAGE_BUCKET_NAME=${{ secrets.AWS_STORAGE_BUCKET_NAME }} \
-e AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} \
-e AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} \
-e DATABASE_URL=${{ secrets.DATABASE_URL }} \
app make import/${{ matrix.transaction_type }}_${{ matrix.quarter }}_${{ matrix.year }}