From 65f9cb2d87816a2ecadd460fed3056cc197dc3aa Mon Sep 17 00:00:00 2001 From: yulike Date: Mon, 14 Nov 2022 13:00:09 -0500 Subject: [PATCH] added the run chain --- .github/workflows/run_chain_template.yml | 50 ++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/run_chain_template.yml diff --git a/.github/workflows/run_chain_template.yml b/.github/workflows/run_chain_template.yml new file mode 100644 index 0000000..8ad4574 --- /dev/null +++ b/.github/workflows/run_chain_template.yml @@ -0,0 +1,50 @@ +name: dbt_run + +on: + push: + branches: + - "main" + # uncheck the following to set it up with CRON + # schedule: + # Runs "every 10 mins" + # - cron: "*/10 * * * *" + +env: + DBT_PROFILES_DIR: ./ + + ACCOUNT: "${{ secrets.ACCOUNT }}" + ROLE: "${{ secrets.ROLE }}" + USER: "${{ secrets.USER }}" + PASSWORD: "${{ secrets.PASSWORD }}" + REGION: "${{ secrets.REGION }}" + DATABASE_DEV: "${{ secrets.DATABASE_DEV }}" + DATABASE_PROD: "${{ secrets.DATABASE_PROD }}" + WAREHOUSE_DEV: "${{ secrets.WAREHOUSE_DEV }}" + WAREHOUSE_PROD: "${{ secrets.WAREHOUSE_PROD }}" + SCHEMA: "${{ secrets.SCHEMA }}" + +jobs: + scheduled_run: + name: dbt_run + runs-on: ubuntu-latest + environment: + name: workflow + + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-python@v1 + with: + python-version: "3.7.x" + + - name: install dependencies + run: | + pip install dbt-snowflake + dbt deps + + - name: Run dbt models + run: | + dbt run -m ./models/streamline/streamline__txs_history.sql + dbt run -m ./models/streamline/streamline__txs_realtime.sql + dbt run -m ./models/streamline/streamline__blocks_history.sql + dbt run -m ./models/streamline/streamline__blocks_realtime.sql \ No newline at end of file