Skip to content

Commit 75e236f

Browse files
author
Student
committed
add daily refresh workflow
1 parent 5f664dc commit 75e236f

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Daily Refresh (Production)
2+
3+
on:
4+
schedule:
5+
- cron: '0 8 * * *' # Runs daily at 8am UTC
6+
7+
workflow_dispatch:
8+
9+
jobs:
10+
build-and-deploy:
11+
runs-on: ubuntu-latest
12+
env:
13+
DBT_USER: ${{ secrets.DBT_USER }}
14+
DBT_PASSWORD: ${{ secrets.DBT_PASSWORD }}
15+
DATABASE_HOST: ${{ secrets.DATABASE_HOST }}
16+
DATABASE_PORT: ${{ secrets.DATABASE_PORT }}
17+
18+
steps:
19+
- name: Checkout branch
20+
uses: actions/checkout@v3
21+
22+
- name: Setup Python
23+
uses: actions/setup-python@v4
24+
with:
25+
python-version: '3.9'
26+
27+
- name: Install dbt
28+
run: pip install dbt-core==1.8.7 dbt-postgres==1.8.2
29+
30+
- name: Install dbt Packages
31+
run: dbt deps
32+
33+
- name: Deploy & Test Models (dbt build)
34+
run: >
35+
dbt build -s warehouse marts
36+
--exclude dim_calendar_dates
37+
--profiles-dir _project_docs/automation
38+
--target prod

0 commit comments

Comments
 (0)