From 8bec0e51d7788c02ee1d725bae88a29d67f45d1b Mon Sep 17 00:00:00 2001 From: drethereum Date: Wed, 30 Oct 2024 13:56:48 -0600 Subject: [PATCH] update makefile and workflow --- .../workflows/dbt_deploy_new_workflows.yml | 45 +++++++++++++++++++ .github/workflows/dbt_test_daily.yml | 5 +++ makefile | 6 +-- 3 files changed, 52 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/dbt_deploy_new_workflows.yml diff --git a/.github/workflows/dbt_deploy_new_workflows.yml b/.github/workflows/dbt_deploy_new_workflows.yml new file mode 100644 index 0000000..6c44671 --- /dev/null +++ b/.github/workflows/dbt_deploy_new_workflows.yml @@ -0,0 +1,45 @@ +name: dbt_deploy_new_workflows +run-name: dbt_deploy_new_workflows + +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_test + + 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: Deploy New Github Actions + run: | + make deploy_new_github_action DBT_TARGET=prod \ No newline at end of file diff --git a/.github/workflows/dbt_test_daily.yml b/.github/workflows/dbt_test_daily.yml index 44c6d55..dd4ec0e 100644 --- a/.github/workflows/dbt_test_daily.yml +++ b/.github/workflows/dbt_test_daily.yml @@ -34,6 +34,11 @@ jobs: with: python-version: "3.10" cache: "pip" + + - name: install dependencies + run: | + pip install -r requirements.txt + dbt deps - name: Build Daily Testing Views run: | diff --git a/makefile b/makefile index a3b4500..99710c1 100644 --- a/makefile +++ b/makefile @@ -32,6 +32,7 @@ else endif deploy_new_github_action: + dbt run-operation fsc_evm.drop_github_actions_schema -t $(DBT_TARGET) dbt seed -s github_actions__workflows -t $(DBT_TARGET) dbt run -m "fsc_evm,tag:gha_tasks" --full-refresh -t $(DBT_TARGET) ifeq ($(findstring dev,$(DBT_TARGET)),dev) @@ -40,7 +41,4 @@ else dbt run-operation fsc_utils.create_gha_tasks --vars '{"START_GHA_TASKS":True}' -t $(DBT_TARGET) endif -regular_incremental: - dbt run -m "fsc_evm,tag:core" -t $(DBT_TARGET) - -.PHONY: deploy_streamline_functions deploy_streamline_tables deploy_streamline_requests deploy_github_actions cleanup_time regular_incremental deploy_new_github_action \ No newline at end of file +.PHONY: deploy_streamline_functions deploy_streamline_tables deploy_streamline_requests deploy_github_actions cleanup_time deploy_new_github_action \ No newline at end of file