Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions .github/workflows/cd-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: CD Workflow

on:
push:
branches:
- main

jobs:
cd-deploy-test:
name: Deploy to TEST
runs-on: ubuntu-latest
environment: test
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Install Databricks CLI
run: curl -fsSL https://raw.githubusercontent.com/databricks/setup-cli/main/install.sh | sh

- name: Install Dependencies
run: |
pip install --upgrade pip
pip install setuptools wheel

- name: Configure Databricks
run: |
# write out the profile (here called "TEST")
cat <<EOF > ~/.databrickscfg
[TEST]
host = https://dbc-7fec11f6-2f19.cloud.databricks.com
client_id = ${{ secrets.SP_CLIENT_ID }}
client_secret = ${{ secrets.SP_CLIENT_SECRET }}
EOF

- name: Deploy to TEST
run: |
databricks bundle deploy \
--target test \
--profile TEST

cd-deploy-prod:
name: Deploy to PROD
needs: cd-deploy-test
runs-on: ubuntu-latest
environment: prod
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Install Databricks CLI
run: curl -fsSL https://raw.githubusercontent.com/databricks/setup-cli/main/install.sh | sh

- name: Install Dependencies
run: |
pip install --upgrade pip
pip install setuptools wheel

- name: Configure Databricks
run: |
# write out the profile (here called "PROD")
cat <<EOF > ~/.databrickscfg
[PROD]
host = https://dbc-af8eb77a-a3a0.cloud.databricks.com
client_id = ${{ secrets.SP_CLIENT_ID }}
client_secret = ${{ secrets.SP_CLIENT_SECRET }}
EOF

- name: Deploy to PROD
run: |
databricks bundle deploy \
--target prod \
--profile PROD
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ __pycache__/
.venv*/
venv*/

sandbox/
scratch/**
!scratch/README.md
**/explorations/**
Expand Down
Loading