Skip to content

Instantly share code, notes, and snippets.

@segoldma
segoldma / README.md
Created September 6, 2023 03:05 — forked from jeremyyeo/README.md

dbt Cloud Slim CI using GitHub Actions

Video: https://www.loom.com/share/020361ffc62e49ffa55deabd819fe166

Reproducing dbt Cloud Slim CI functionality using GitHub Actions - for cases when the dbt Cloud native GitHub App cannot be used or Slim CI isn't working as expected.

The GitHub Action workflow used in the video above is available below in dbt-cloud-actions-fal.yml.

Update (2023-02-27) - there can be scenarios where GitHub Administrators block GitHub Actions that are not from GitHub itself, so I have added a new workflow (dbt-cloud-actions-native.yml) which uses a Python script saved in the repo itself (dbt_cloud.py) instead of using Fal's action as shown in the video above.

with
dau as (
-- This part of the query can be pretty much anything.
-- The only requirement is that it have three columns:
-- dt, user_id, inc_amt
-- Where dt is a date and user_id is some unique identifier for a user.
-- Each dt-user_id pair should be unique in this table.
-- inc_amt represents the amount of value that this user created on dt.
-- The most common case is
-- inc_amt = incremental revenue from the user on dt