Cleanup Workflows (#42)

This commit is contained in:
Julius Remigio 2023-08-21 11:13:06 -07:00 committed by GitHub
parent 0bf8f27edf
commit db56fe2a31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 75 deletions

View File

@ -3,8 +3,9 @@ on:
workflow_call:
inputs:
warehouse:
required: true
required: false
type: string
default: DBT_CLOUD
environment:
required: true
type: string
@ -56,3 +57,10 @@ jobs:
- name: Run DBT Jobs
run: |
dbt ${{ inputs.command }}
- name: Store logs
uses: actions/upload-artifact@v3
with:
name: dbt-logs
path: |
logs
target

View File

@ -26,46 +26,14 @@ on:
description: 'DBT Run Command'
required: true
env:
DBT_PROFILES_DIR: ./
ACCOUNT: "${{ vars.ACCOUNT }}"
ROLE: "${{ vars.ROLE }}"
USER: "${{ vars.USER }}"
PASSWORD: "${{ secrets.PASSWORD }}"
REGION: "${{ vars.REGION }}"
DATABASE: "${{ vars.DATABASE }}"
WAREHOUSE: "${{ inputs.warehouse }}"
SCHEMA: "${{ vars.SCHEMA }}"
concurrency:
group: ${{ github.workflow }}
jobs:
run_dbt_jobs:
runs-on: ubuntu-latest
environment:
name: workflow_${{ inputs.environment }}
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 ${{ inputs.dbt_command }}
- name: Store logs
uses: actions/upload-artifact@v3
with:
name: dbt-logs
path: logs
ad_hoc:
uses: ./.github/workflows/dbt.yml
secrets: inherit
with:
warehouse: ${{ inputs.warehouse }}
environment: workflow_${{ inputs.environment }}
command: ${{ inputs.dbt_command }}

View File

@ -7,40 +7,13 @@ on:
# Runs "at 9:00 UTC" (see https://crontab.guru)
- cron: '0 9 * * *'
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-operation run_sp_create_prod_clone
dev_refresh:
uses: ./.github/workflows/dbt.yml
secrets: inherit
with:
environment: workflow_prod
command: run-operation run_sp_create_prod_clone

View File

@ -27,7 +27,7 @@ concurrency:
group: ${{ github.workflow }}
jobs:
scheduled_job:
scheduled:
uses: ./.github/workflows/dbt.yml
if: github.event_name == 'schedule' || github.event_name == 'push'
secrets: inherit
@ -36,7 +36,7 @@ jobs:
environment: workflow_${{ inputs.environment }}
command: test --selector test_udfs
manual_job:
dispached:
uses: ./.github/workflows/dbt.yml
if: github.event_name == 'workflow_dispatch'
secrets: inherit