Update dbt_run_on_merge.yaml #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: dbt CI pipeline | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- "*" | |
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: Set up Python environment | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.11' | |
- name: Decode keyfile | |
run: echo "${{ secrets.KEYS_JSON }}" | base64 -d > keyfile.json | |
- name: Set up environment variables | |
run: | | |
export KEY_FILE="keyfile.json" | |
echo "KEY_FILE=$KEY_FILE" >> $GITHUB_ENV | |
- name: Install dbt dependencies | |
run: | | |
pip install --upgrade pip | |
pip install dbt | |
pip install dbt-bigquery --force-reinstall | |
pip install dbt-core | |
- name: Install dbt dependencies | |
run: dbt deps | |
- name: Run Tests | |
run: dbt test | |
- name: Build dbt Project | |
run: dbt build |