Skip to content

refactor

refactor #11

# This GitHub workflow deploys Bundle resources (ML resource config and more)
# defined under mlops_demo/resources/*
# and mlops_demo/databricks.yml with staging deployment target configs,
# when PRs are merged into the default/main branch
name: Bundle Deployment for mlops_demo Staging
on:
pull_request:
types:
- closed # Trigger workflow when a pull request is closed (merged or not)
workflow_dispatch:
defaults:
run:
working-directory: ./mlops_demo
env:
DATABRICKS_TOKEN: ${{ secrets.STAGING_WORKSPACE_TOKEN }}
jobs:
staging:
if: github.event.pull_request.merged == true # Ensures it runs only if the PR is merged
concurrency: mlops_demo-staging-bundle-job
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: databricks/[email protected]
- name: Validate Bundle For Staging
id: validate
run: |
databricks bundle validate -t qa
- name: Deploy Bundle to Staging
id: deploy
run: |
databricks bundle deploy -t qa