Skip to content

Commit

Permalink
feat: Create dbt_run_on_merge.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
mutasim77 authored Apr 4, 2024
1 parent 7147a98 commit 040a9b7
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/dbt_run_on_merge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: dbt CI pipeline

# Triggers on push to main branch
# or Pull Request to any branch
on:
push:
branches:
- main
pull_request:
branches:
- "*"

# Set needed env variables
env:
DBT_ACCOUNT_ID: ${{ secrets.DBT_ACCOUNT_ID }}
DBT_PROJECT_ID: ${{ secrets.DBT_PROJECT_ID }}
DBT_PR_JOB_ID: ${{ secrets.DBT_JOB_ID }}
DBT_API_KEY: ${{ secrets.DBT_API_KEY }}
DBT_JOB_CAUSE: 'GitHub Pipeline CI Job'
DBT_JOB_BRANCH: ${{ github.ref }}

jobs:
ci-tests:
name: dbt run and test CI checks
runs-on: ubuntu-latest
timeout-minutes: 90

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Python environment
uses: actions/setup-python@v2
with:
python-version: "3.11"

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install dbt
- name: Install dbt deps
run: dbt deps

- name: Run Tests
run: dbt test

- name: Build dbt Project
run: dbt build

0 comments on commit 040a9b7

Please sign in to comment.