From 0c5f95becdb34dbe03b8aaf38a30e32ca874d8bf Mon Sep 17 00:00:00 2001 From: drethereum Date: Thu, 31 Aug 2023 10:35:47 -0600 Subject: [PATCH] update jobs --- .github/workflows/dbt_run_adhoc.yml | 12 +++--- .github/workflows/dbt_run_daily.yml | 7 ++-- .github/workflows/dbt_run_deployment.yml | 46 +++++++++++++++++++++++ .github/workflows/dbt_run_dev_refresh.yml | 7 ++-- .github/workflows/dbt_run_weekly.yml | 7 ++-- .github/workflows/dbt_test.yml | 7 ++-- requirements.txt | 1 + 7 files changed, 68 insertions(+), 19 deletions(-) create mode 100644 .github/workflows/dbt_run_deployment.yml create mode 100644 requirements.txt diff --git a/.github/workflows/dbt_run_adhoc.yml b/.github/workflows/dbt_run_adhoc.yml index b116e3e..757ff1c 100644 --- a/.github/workflows/dbt_run_adhoc.yml +++ b/.github/workflows/dbt_run_adhoc.yml @@ -48,21 +48,19 @@ jobs: runs-on: ubuntu-latest environment: name: workflow_${{ inputs.environment }} - strategy: - matrix: - command: ${{fromJson(inputs.dbt_command)}} steps: - uses: actions/checkout@v3 - - uses: actions/setup-python@v1 + - uses: actions/setup-python@v4 with: - python-version: "3.7.x" + python-version: "3.10" + cache: "pip" - name: install dependencies run: | - pip3 install dbt-snowflake==${{ vars.DBT_VERSION }} cli_passthrough requests click + pip install -r requirements.txt dbt deps - name: Run DBT Jobs run: | - ${{ matrix.command }} \ No newline at end of file + ${{ inputs.dbt_command }} \ No newline at end of file diff --git a/.github/workflows/dbt_run_daily.yml b/.github/workflows/dbt_run_daily.yml index d3adcfa..63b2897 100644 --- a/.github/workflows/dbt_run_daily.yml +++ b/.github/workflows/dbt_run_daily.yml @@ -31,13 +31,14 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: actions/setup-python@v1 + - uses: actions/setup-python@v4 with: - python-version: "3.7.x" + python-version: "3.10" + cache: "pip" - name: install dependencies run: | - pip3 install dbt-snowflake==${{ vars.DBT_VERSION }} cli_passthrough requests click + pip install -r requirements.txt dbt deps - name: Run DBT Jobs run: | diff --git a/.github/workflows/dbt_run_deployment.yml b/.github/workflows/dbt_run_deployment.yml new file mode 100644 index 0000000..77ba297 --- /dev/null +++ b/.github/workflows/dbt_run_deployment.yml @@ -0,0 +1,46 @@ +name: dbt_run_deployment +run-name: dbt_run_deployment + +on: + workflow_dispatch: + branches: + - "main" + inputs: + warehouse: + type: choice + description: Snowflake warehouse + required: true + options: + - DBT + - DBT_CLOUD + - DBT_EMERGENCY + default: DBT + dbt_command: + type: string + description: 'DBT Run Command' + required: true + +env: + 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: "${{ inputs.WAREHOUSE }}" + SCHEMA: "${{ vars.SCHEMA }}" + +concurrency: + group: ${{ github.workflow }} + +jobs: + called_workflow_template: + uses: FlipsideCrypto/analytics-workflow-templates/.github/workflows/dbt_run_deployment_template.yml@main + with: + dbt_command: | + ${{ inputs.dbt_command }} + environment: workflow_prod + warehouse: ${{ inputs.WAREHOUSE }} + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_run_dev_refresh.yml b/.github/workflows/dbt_run_dev_refresh.yml index fdec8fe..0ec82a6 100644 --- a/.github/workflows/dbt_run_dev_refresh.yml +++ b/.github/workflows/dbt_run_dev_refresh.yml @@ -31,13 +31,14 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: actions/setup-python@v1 + - uses: actions/setup-python@v4 with: - python-version: "3.7.x" + python-version: "3.10" + cache: "pip" - name: install dependencies run: | - pip3 install dbt-snowflake==${{ vars.DBT_VERSION }} cli_passthrough requests click + pip install -r requirements.txt dbt deps - name: Run DBT Jobs run: | diff --git a/.github/workflows/dbt_run_weekly.yml b/.github/workflows/dbt_run_weekly.yml index 0fe31fb..00139ea 100644 --- a/.github/workflows/dbt_run_weekly.yml +++ b/.github/workflows/dbt_run_weekly.yml @@ -31,13 +31,14 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: actions/setup-python@v1 + - uses: actions/setup-python@v4 with: - python-version: "3.7.x" + python-version: "3.10" + cache: "pip" - name: install dependencies run: | - pip3 install dbt-snowflake==${{ vars.DBT_VERSION }} cli_passthrough requests click + pip install -r requirements.txt dbt deps - name: Run DBT Jobs run: | diff --git a/.github/workflows/dbt_test.yml b/.github/workflows/dbt_test.yml index 13e690f..0952e1d 100644 --- a/.github/workflows/dbt_test.yml +++ b/.github/workflows/dbt_test.yml @@ -33,13 +33,14 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: actions/setup-python@v1 + - uses: actions/setup-python@v4 with: - python-version: "3.7.x" + python-version: "3.10" + cache: "pip" - name: install dependencies run: | - pip3 install dbt-snowflake==${{ vars.DBT_VERSION }} cli_passthrough requests click + pip install -r requirements.txt dbt deps - name: Run DBT Jobs run: | diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..ec44b06 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +dbt-snowflake>=1.4,<1.5 \ No newline at end of file