-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (46 loc) · 2 KB
/
dbt_prod.yml
File metadata and controls
57 lines (46 loc) · 2 KB
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
48
49
50
51
52
53
54
55
56
57
name: dbt prod incremental
on:
# schedule:
# - cron: '0 * * * *' # Run every hour at minute 0
# NOTE: Schedule is disabled by default. Uncomment when ready to enable hourly production runs.
# Check the README.md to make sure you understand the credit costs associated with running dbt.
workflow_dispatch: # Allow manual triggers
concurrency:
group: dbt-prod-runs # Shared group with dbt_deploy.yml to prevent concurrent production runs
cancel-in-progress: false # Don't cancel in-progress runs, queue instead
jobs:
dbt-prod:
runs-on: ubuntu-latest
# Incremental prod runs can still be long depending on chain activity.
timeout-minutes: 120
env:
DUNE_API_KEY: ${{ secrets.DUNE_API_KEY }}
DUNE_TEAM_NAME: ${{ vars.DUNE_TEAM_NAME }}
DBT_TARGET: prod # All dbt commands will use the prod target from profiles.yml
# Workaround for API keys without permission to call dune._internal.alter_view_properties.
# Remove once key permissions are upgraded for view/table metadata property updates.
DUNE_SKIP_VIEW_PROPERTIES: ${{ vars.DUNE_SKIP_VIEW_PROPERTIES || 'true' }}
steps:
- name: Check out code
uses: actions/checkout@v4
with:
ref: main
- name: Validate required environment
run: |
if [ -z "${DUNE_TEAM_NAME}" ]; then
echo "❌ Missing required GitHub variable: DUNE_TEAM_NAME"
echo "Set it in Settings -> Secrets and variables -> Actions -> Variables."
exit 1
fi
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Install dependencies
run: uv sync --locked
- name: Install dbt packages
run: uv run dbt deps
- name: Run models
run: uv run dbt run --exclude config.materialized:view # views should only run when modified
- name: Test models
run: uv run dbt test --exclude config.materialized:view # views should only be tested when modified