Skip to content

Run DBT Project

Run DBT Project #32

Workflow file for this run

name: Run DBT Project
on:
schedule:
- cron: '0 6 * * *' # 6 AM UTC
- cron: '0 14 * * *' # 2 PM UTC
- cron: '0 22 * * *' # 10 PM UTC
workflow_dispatch: # Allows for manual triggering of the workflow
jobs:
run-dbt:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.12' # Adjust the Python version as needed
- name: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
sudo apt-get install git
- name: Run DBT
run: |
cd petro_dbt
dbt deps
dbt run
- name: Check for changes
run: git status
- name: Configure git
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: Commit and push changes
run: |
git add files/*
git commit -m "Update files from DBT run"
git push https://x-access-token:${{ secrets.PAT }}@github.com/${{ github.repository }}.git main
if: |

Check failure on line 56 in .github/workflows/dbt.yaml

View workflow run for this annotation

GitHub Actions / Run DBT Project

Invalid workflow file

The workflow is not valid. .github/workflows/dbt.yaml (Line: 56, Col: 13): Unrecognized named-value: 'git'. Located at position 1 within expression: git diff --quiet || echo "Changes detected"
git diff --quiet || echo "Changes detected"