name: dbt_run_streamline_transactions_realtime
run-name: dbt_run_streamline_transactions_realtime

on:
  workflow_dispatch:
  # schedule:
  #   # Runs "at minute 8 and 38, every hour" (see https://crontab.guru)
  #   - cron: '8,38 * * * *'

env:
  DBT_PROFILES_DIR: ./

  ACCOUNT: "${{ vars.ACCOUNT }}"
  ROLE: "${{ vars.ROLE }}"
  USER: "${{ vars.USER }}"
  PASSWORD: "${{ secrets.PASSWORD }}"
  REGION: "${{ vars.REGION }}"
  DATABASE: "${{ vars.DATABASE }}"
  WAREHOUSE: "${{ vars.WAREHOUSE }}"
  SCHEMA: "${{ vars.SCHEMA }}"

concurrency:
  group: ${{ github.workflow }}

jobs:
  called_workflow_template:
    uses: FlipsideCrypto/analytics-workflow-templates/.github/workflows/dbt_run_template.yml@main
    with:
      dbt_command: |
         dbt run --vars '{"STREAMLINE_INVOKE_STREAMS":True}' -m 1+models/streamline/core/realtime/streamline__transactions_realtime.sql
      environment: workflow_prod
      warehouse: ${{ vars.WAREHOUSE }}
    secrets: inherit
