-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from luffyofproduct/add-daily-refresh
Add Daily Refresh Workflow (Scheduled Job)
- Loading branch information
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Daily Refresh (Production) | ||
|
||
on: | ||
schedule: | ||
- cron: '0 8 * * *' # Runs daily at 8am UTC | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
env: | ||
DBT_USER: ${{ secrets.DBT_USER }} | ||
DBT_PASSWORD: ${{ secrets.DBT_PASSWORD }} | ||
DATABASE_HOST: ${{ secrets.DATABASE_HOST }} | ||
DATABASE_PORT: ${{ secrets.DATABASE_PORT }} | ||
|
||
steps: | ||
- name: Checkout branch | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.9' | ||
|
||
- name: Install dbt | ||
run: pip install dbt-postgres | ||
|
||
- name: Install dbt Packages | ||
run: dbt deps | ||
|
||
- name: Deploy & Test Models (dbt build) | ||
run: > | ||
dbt build -s warehouse marts | ||
--exclude dim_calendar_dates | ||
--profiles-dir _project_docs/automation | ||
--target prod |