-
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (40 loc) · 1.26 KB
/
update-db.yaml
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: Update DB
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
schedule:
# Run the job every day at 12:00 AM UTC
- cron: '0 0 * * *'
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-west-2
OFFSETS_DB_API_KEY_STAGING: ${{ secrets.OFFSETS_DB_API_KEY_STAGING }}
OFFSETS_DB_API_KEY_PRODUCTION: ${{ secrets.OFFSETS_DB_API_KEY_PRODUCTION }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
seed-db:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install fsspec requests s3fs pandas
- name: Seed Staging Database
run: |
python update_database.py staging https://offsets-db-staging.fly.dev/files
- name: Seed Production Database
if: github.event_name == 'workflow_dispatch' || github.event_name == 'schedule'
run: |
python update_database.py production https://offsets-db.fly.dev/files