-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (43 loc) · 1.25 KB
/
python_jobs.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
name: python_jobs
on:
# Run nightly at 8AM UTC (12AM Pacific)
schedule:
- cron: "7 8 * * 1-5"
# Also allow for manual triggers
push:
branches:
- main
workflow_dispatch:
env:
SNOWFLAKE_PRIVATE_KEY: ${{ SECRETS.SNOWFLAKE_PRIVATE_KEY_PRD }}
SNOWFLAKE_USER: ${{ SECRETS.SNOWFLAKE_USER_PRD }}
SNOWFLAKE_ACCOUNT: ${{ SECRETS.SNOWFLAKE_ACCOUNT }}
jobs:
run-python-jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "poetry"
- uses: actions/cache@v2
with:
key: ${{ github.ref }}
path: .cache
- name: Install dependencies
run: poetry install --no-root
- name: Load GIS Datasets
env:
SNOWFLAKE_DATABASE: RAW_PRD
SNOWFLAKE_WAREHOUSE: LOADING_XS_PRD
SNOWFLAKE_ROLE: LOADER_PRD
run: poetry run python -m jobs.load_geo_reference_data
- name: Create UDFs
env:
SNOWFLAKE_DATABASE: ANALYTICS_PRD
SNOWFLAKE_WAREHOUSE: TRANSFORMING_XS_PRD
SNOWFLAKE_ROLE: TRANSFORMER_PRD
run: poetry run python -m jobs.create_stored_procedures