Skip to content

Run dbt

Run dbt #617

Workflow file for this run

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