Skip to content

scheduled clean up job - drop non-prod scheams #228

scheduled clean up job - drop non-prod scheams

scheduled clean up job - drop non-prod scheams #228

name: scheduled clean up job - drop non-prod scheams
on:
schedule:
- cron: "0 12 * * *"
jobs:
dbt_scheduled_cleanup_run:
runs-on: ubuntu-latest
env:
HOST: ${{ secrets.HOST }}
DATABASE: ${{ secrets.DATABASE }}
USERNAME: ${{ secrets.PROD_USERNAME }}
PASSWORD: ${{ secrets.PROD_PASSWORD }}
PORT: ${{ secrets.PORT }}
SCHEMA: ${{ secrets.PROD_SCHEMA }}
steps:
- uses: "actions/checkout@main"
- name: install requirements
run: pip install -q -r requirements.txt
- name: dbt deps
run: |
cd project_goes_here
dbt deps
- name: dbt run operation
run: |
cd project_goes_here
dbt run-operation drop_old_relations --args '{dry_run: "true"}'