From 48b86993d6671b5652332c2702bceeb26dd4c0bb Mon Sep 17 00:00:00 2001 From: gwen windflower Date: Thu, 18 Apr 2024 18:47:38 -0500 Subject: [PATCH] chore(Postgres GitHub Actions): Add CI/CD for Postgres Adds 3 Postgres GHAs: - CI on PRs against staging - CD on merge to staging - CD on merge to main --- .github/workflows/cd_prod.yml | 24 ++++++++++++++++++++++++ .github/workflows/cd_staging.yml | 28 ++++++++++++++++++++++++++-- .github/workflows/ci.yml | 25 +++++++++++++++++++++++++ 3 files changed, 75 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cd_prod.yml b/.github/workflows/cd_prod.yml index d005ed5a..a77a9d2b 100644 --- a/.github/workflows/cd_prod.yml +++ b/.github/workflows/cd_prod.yml @@ -53,3 +53,27 @@ jobs: run: uv pip install -r requirements.txt --system - name: Run dbt Cloud job run: python3 .github/workflows/scripts/dbt_cloud_run_job.py + + run_postgres: + name: dbt Cloud Deploy Prod Postgres + runs-on: macos-latest + + env: + DBT_ACCOUNT_ID: 188483 + DBT_PROJECT_ID: 288405 + DBT_PR_JOB_ID: 577871 + DBT_API_KEY: ${{ secrets.DBT_CLOUD_API_KEY }} + DBT_JOB_CAUSE: "GitHub Actions Request" + DBT_JOB_BRANCH: main + + steps: + - uses: "actions/checkout@v4" + - uses: "actions/setup-python@v5" + with: + python-version: "3.12" + - name: Install uv + run: python3 -m pip install uv + - name: Install deps + run: uv pip install -r requirements.txt --system + - name: Run dbt Cloud job + run: python3 .github/workflows/scripts/dbt_cloud_run_job.py diff --git a/.github/workflows/cd_staging.yml b/.github/workflows/cd_staging.yml index e1cf2325..b5d161d8 100644 --- a/.github/workflows/cd_staging.yml +++ b/.github/workflows/cd_staging.yml @@ -16,7 +16,7 @@ jobs: DBT_PR_JOB_ID: 565266 DBT_API_KEY: ${{ secrets.DBT_CLOUD_API_KEY }} DBT_JOB_CAUSE: "GitHub Actions Request" - DBT_JOB_BRANCH: main + DBT_JOB_BRANCH: staging steps: - uses: "actions/checkout@v4" @@ -40,7 +40,31 @@ jobs: DBT_PR_JOB_ID: 560539 DBT_API_KEY: ${{ secrets.DBT_CLOUD_API_KEY }} DBT_JOB_CAUSE: "GitHub Actions Request" - DBT_JOB_BRANCH: main + DBT_JOB_BRANCH: staging + + steps: + - uses: "actions/checkout@v4" + - uses: "actions/setup-python@v5" + with: + python-version: "3.12" + - name: Install uv + run: python3 -m pip install uv + - name: Install deps + run: uv pip install -r requirements.txt --system + - name: Run dbt Cloud job + run: python3 .github/workflows/scripts/dbt_cloud_run_job.py + + run_postgres: + name: dbt Cloud Deploy Staging Postgres + runs-on: macos-latest + + env: + DBT_ACCOUNT_ID: 188483 + DBT_PROJECT_ID: 288405 + DBT_PR_JOB_ID: 577883 + DBT_API_KEY: ${{ secrets.DBT_CLOUD_API_KEY }} + DBT_JOB_CAUSE: "GitHub Actions Request" + DBT_JOB_BRANCH: staging steps: - uses: "actions/checkout@v4" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 86609440..51de57a0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,3 +54,28 @@ jobs: run: uv pip install -r requirements.txt --system - name: Run dbt Cloud job run: python3 .github/workflows/scripts/dbt_cloud_run_job.py + + run_postgres: + name: dbt Cloud PR CI Postgres + runs-on: macos-latest + + env: + DBT_ACCOUNT_ID: 188483 + DBT_PROJECT_ID: 288405 + DBT_PR_JOB_ID: 577887 + DBT_API_KEY: ${{ secrets.DBT_CLOUD_API_KEY }} + DBT_JOB_CAUSE: "GitHub Actions Request" + DBT_JOB_BRANCH: ${{ github.head_ref }} + DBT_JOB_SCHEMA_OVERRIDE: dbt_jsdx__pr_${{ github.head_ref}} + + steps: + - uses: "actions/checkout@v4" + - uses: "actions/setup-python@v5" + with: + python-version: "3.12" + - name: Install uv + run: python3 -m pip install uv + - name: Install deps + run: uv pip install -r requirements.txt --system + - name: Run dbt Cloud job + run: python3 .github/workflows/scripts/dbt_cloud_run_job.py