Skip to content

profiles.yml will create it on the fly #66

profiles.yml will create it on the fly

profiles.yml will create it on the fly #66

Workflow file for this run

name: Our first dbt PR job
on:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
push:
branches:
- '!main'
jobs:
dbt_ci:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Set Up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Install requirements
run: pip install -r requirements.txt
- name: Create profiles.yml
run: |
mkdir -p ~/.dbt
cat <<EOF > ~/.dbt/profiles.yml
dbt_arghyam:
outputs:
dev:
dbname: "{{ env_var('POSTGRES_DBNAME') }}"
host: "{{ env_var('POSTGRES_HOST') }}"
password: "{{ env_var('POSTGRES_PASSWORD') }}"
port: 5432
schema: dev
threads: 8
type: postgres
user: "{{ env_var('POSTGRES_USER') }}"
target: dev
EOF
- name: Install dbt dependencies
run: dbt deps
- name: dbt build
run: dbt build --full-refresh
env:
POSTGRES_DBNAME: ${{ secrets.POSTGRES_DBNAME }}
POSTGRES_USER: ${{ secrets.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
POSTGRES_HOST: ${{ secrets.POSTGRES_HOST }}
DBT_PROFILES_DIR: ~/.dbt
- name: Benchmarking models
run: sqlfluff lint models --bench
- name: Lint models
run: sqlfluff lint models -f human