From e51cf7ff124dc79bacd4aaeb1dd129cdae1e3186 Mon Sep 17 00:00:00 2001 From: Eric Laurello Date: Fri, 7 Feb 2025 08:29:07 -0500 Subject: [PATCH] core sched --- .github/workflows/dbt_run_dev_refresh.yml | 4 +- .../workflows/dbt_run_incremental_core.yml | 47 +++++++++++++++++++ 2 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/dbt_run_incremental_core.yml diff --git a/.github/workflows/dbt_run_dev_refresh.yml b/.github/workflows/dbt_run_dev_refresh.yml index 53339a5..2df446e 100644 --- a/.github/workflows/dbt_run_dev_refresh.yml +++ b/.github/workflows/dbt_run_dev_refresh.yml @@ -3,8 +3,8 @@ run-name: dbt_run_dev_refresh on: workflow_dispatch: - # schedule: - # - cron: '27 8 * * *' + schedule: + - cron: '27 8 * * *' env: DBT_PROFILES_DIR: "${{ vars.DBT_PROFILES_DIR }}" diff --git a/.github/workflows/dbt_run_incremental_core.yml b/.github/workflows/dbt_run_incremental_core.yml new file mode 100644 index 0000000..0920553 --- /dev/null +++ b/.github/workflows/dbt_run_incremental_core.yml @@ -0,0 +1,47 @@ +name: dbt_run_incremental_core +run-name: dbt_run_incremental_core + +on: + workflow_dispatch: + schedule: + # run 25 minutes past the hour, every 4 hours except for 1:25 to get the full previous day + # BQ to SF export runs at 5 after the hour on the same hourly schedule + - cron: "25 1,4,8,12,16,20 * * *" + +env: + DBT_PROFILES_DIR: "${{ vars.DBT_PROFILES_DIR }}" + + ACCOUNT: "${{ vars.ACCOUNT }}" + ROLE: "${{ vars.ROLE }}" + USER: "${{ vars.USER }}" + PASSWORD: "${{ secrets.PASSWORD }}" + REGION: "${{ vars.REGION }}" + DATABASE: "${{ vars.DATABASE }}" + WAREHOUSE: "${{ vars.WAREHOUSE }}" + SCHEMA: "${{ vars.SCHEMA }}" + +concurrency: + group: ${{ github.workflow }} + +jobs: + run_dbt_jobs: + runs-on: ubuntu-latest + environment: + name: workflow_prod + + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-python@v4 + with: + python-version: "${{ vars.PYTHON_VERSION }}" + cache: "pip" + + - name: install dependencies + run: | + pip install -r requirements.txt + dbt deps + - name: Run DBT Jobs + run: | + dbt run -m "stellar_models,tag:scheduled_core" +