Run DBT Project #26
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: 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: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
pip 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 . | ||
git commit -m "Update master branch" | ||
git push origin master | ||
if: | | ||
Check failure on line 48 in .github/workflows/dbt.yaml GitHub Actions / Run DBT ProjectInvalid workflow file
|
||
git diff --quiet || echo "Changes detected" | ||