flow-models/.github/workflows/dbt_run_streamline_external_realtime.yml
2025-09-08 15:08:47 -06:00

66 lines
1.8 KiB
YAML

name: dbt_run_streamline_external_realtime
run-name: dbt_run_streamline_external_realtime
description: |
Runs Streamline jobs that query external APIs.
on:
workflow_dispatch:
schedule:
# Runs every 6 minutes
- cron: "0,6,12,18,24,30,36,42,48,54 * * * *"
env:
USE_VARS: "${{ vars.USE_VARS }}"
DBT_PROFILES_DIR: "${{ vars.DBT_PROFILES_DIR }}"
DBT_VERSION: "${{ vars.DBT_VERSION }}"
ACCOUNT: "${{ vars.ACCOUNT }}"
ROLE: "${{ vars.ROLE }}"
USER: "${{ vars.USER }}"
PASSWORD: "${{ secrets.PASSWORD }}"
REGION: "${{ vars.REGION }}"
DATABASE: "${{ vars.DATABASE }}"
WAREHOUSE: "${{ vars.WAREHOUSE }}"
SCHEMA: "${{ vars.SCHEMA }}"
FLOW_POINTS_URL: "${{ secrets.FLOW_POINTS_URL }}"
PRIVATE_KEY: "${{ secrets.PRIVATE_KEY }}"
PUBLIC_ADDRESS: "${{ secrets.PUBLIC_ADDRESS }}"
concurrency:
group: ${{ github.workflow }}
jobs:
run_dbt_jobs:
runs-on: ubuntu-latest
environment:
name: workflow_prod
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "pip"
- name: install dependencies
run: |
pip install -r requirements.txt
dbt deps
- name: Request Storefront Items and Transaction Entries from Snag API
run: >
dbt run -s streamline__minting_assets_realtime 1+streamline__transaction_entries_realtime --vars '{"STREAMLINE_INVOKE_STREAMS": True}'
- name: Store logs
uses: actions/upload-artifact@v4
with:
name: dbt-logs
path: |
logs
target
notify-failure:
needs: [run_dbt_jobs]
if: failure()
uses: ./.github/workflows/slack_notify.yml
secrets:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}