mirror of
https://github.com/FlipsideCrypto/avalanche-models.git
synced 2026-02-06 13:36:53 +00:00
alerts (#318)
This commit is contained in:
parent
19f6bf3f0d
commit
5180fd05c6
53
.github/workflows/dbt_run_dummy_workflow.yml
vendored
Normal file
53
.github/workflows/dbt_run_dummy_workflow.yml
vendored
Normal file
@ -0,0 +1,53 @@
|
||||
name: dbt_run_dummy_workflow
|
||||
run-name: dbt_run_dummy_workflow
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
branches:
|
||||
- "main"
|
||||
|
||||
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:
|
||||
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: Run DBT Jobs
|
||||
run: |
|
||||
dbt run -m models/silver/utilities/silver__dummy_test.sql
|
||||
|
||||
notify-failure:
|
||||
needs: [run_dbt_jobs]
|
||||
if: failure()
|
||||
uses: ./.github/workflows/slack-notify.yml
|
||||
secrets:
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
||||
48
.github/workflows/slack-notify.yml
vendored
Normal file
48
.github/workflows/slack-notify.yml
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
name: Slack Notification
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
workflow_name:
|
||||
description: 'Name of the workflow'
|
||||
required: false
|
||||
type: string
|
||||
default: ''
|
||||
secrets:
|
||||
SLACK_WEBHOOK_URL:
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
notify:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Send notification to Slack
|
||||
uses: slackapi/slack-github-action@v1.23.0
|
||||
with:
|
||||
payload: |
|
||||
{
|
||||
"text": "⚠️ Workflow Failed: ${{ inputs.workflow_name || github.workflow }}",
|
||||
"blocks": [
|
||||
{
|
||||
"type": "section",
|
||||
"text": {
|
||||
"type": "mrkdwn",
|
||||
"text": "*Workflow:* ${{ inputs.workflow_name || github.workflow }}\n*Repository:* ${{ github.repository }}\n*Branch:* ${{ github.ref_name }}\n*Status:* ❌ Failed"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "actions",
|
||||
"elements": [
|
||||
{
|
||||
"type": "button",
|
||||
"text": {
|
||||
"type": "plain_text",
|
||||
"text": "View Workflow Run"
|
||||
},
|
||||
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
env:
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
||||
7
models/silver/utilities/silver__dummy_test.sql
Normal file
7
models/silver/utilities/silver__dummy_test.sql
Normal file
@ -0,0 +1,7 @@
|
||||
{{ config(
|
||||
materialized = 'table'
|
||||
) }}
|
||||
|
||||
SELECT
|
||||
1 as id,
|
||||
1/0 as will_fail
|
||||
Loading…
Reference in New Issue
Block a user