Skip to content

Generate cloud demo data #962

Generate cloud demo data

Generate cloud demo data #962

name: Generate cloud demo data
on:
schedule:
- cron: "20 3 * * *"
workflow_dispatch:
inputs:
warehouse-type:
type: choice
required: true
description: Type of warehouse platform
options:
- snowflake
env:
DBT_PACKAGE_DEMO_BRANCH_NAME: now-uses-custom-run-started-at
PROFILE_DIR: ${{ github.workspace }}/jaffle_shop_online
jobs:
test:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Write dbt profiles
env:
PROFILES_YML: ${{ secrets.CLOUD_DEMO_PROFILES_YML }}
run: |
echo "$PROFILES_YML" | base64 -d > ${{ env.PROFILE_DIR }}/profiles.yml
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: "3.9.13"
- name: Install dbt
run: >
pip install
"dbt-core"
"dbt-${{ inputs.warehouse-type || 'snowflake' }}"
- name: Install jaffle shop online project
run: |
pip install -e.
- name: Install dbt package
run: |
sed -i 's/package: elementary-data\/elementary/git: https:\/\/github\.com\/elementary-data\/dbt-data-reliability\.git/' ./jaffle_shop_online/packages.yml
sed -i '3s/version: [0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*$/revision: ${{ env.DBT_PACKAGE_DEMO_BRANCH_NAME }}/' ./jaffle_shop_online/packages.yml
dbt deps --project-dir "./jaffle_shop_online"
- name: Run initial demo
run: python data_creation/initial_demo.py --target ${{ inputs.warehouse-type || 'snowflake' }} --days-back 8 --profiles-dir ${{ env.PROFILE_DIR }}