-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (37 loc) · 1.02 KB
/
run_dbt.yml
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
name: Run dbt
on:
schedule:
- cron: '10 4 * * *'
# on:
# push:
# branches:
# - main
env:
DBT_GOOGLE_PROJECT: ${{ secrets.DBT_ENV_SECRET_PROJECT_ID }}
DBT_GOOGLE_DATASET: ${{ secrets.DBT_ENV_SECRET_GOOGLE_DATASET }}
KEYFILE_CONTENTS: ${{ secrets.KEYFILE_CONTENTS }}
DBT_GOOGLE_KEYFILE: /tmp/google/google-service-account.json
jobs:
build:
runs-on: ubuntu-latest
steps:
# Prep Google keyfile
- run: mkdir -p "$(dirname $DBT_GOOGLE_KEYFILE)"
- run: echo "$KEYFILE_CONTENTS" > $DBT_GOOGLE_KEYFILE
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Run image
uses: abatilo/actions-poetry@v2
with:
poetry-version: "1.4.2"
- name: Install poetry dependencies
run: poetry install
- name: Test dbt
run: poetry run dbt test
working-directory: ./dbt_reddit
- name: Run all the models
run: poetry run dbt run
working-directory: ./dbt_reddit