-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
69041ff
commit 37b0f37
Showing
1 changed file
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# This workflow validates, deploys, and runs the specified bundle | ||
# within a pre-production target named "dev". | ||
name: "dev deployment" | ||
|
||
# Ensure that only a single job or workflow using the same concurrency group | ||
# runs at a time. | ||
concurrency: 1 | ||
|
||
# Trigger this workflow whenever a pull request is opened against the repo's | ||
# main branch or an existing pull request's head branch is updated. | ||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
branches: | ||
- main | ||
|
||
jobs: | ||
# Used by the "pipeline_update" job to deploy the bundle. | ||
# Bundle validation is automatically performed as part of this deployment. | ||
# If validation fails, this workflow fails. | ||
deploy: | ||
name: "Deploy bundle" | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Check out this repo, so that this workflow can access it. | ||
- uses: actions/checkout@v3 | ||
|
||
# Download the Databricks CLI. | ||
# See https://github.com/databricks/setup-cli | ||
- uses: databricks/setup-cli@main | ||
|
||
# Deploy the bundle to the "dev" target as defined | ||
# in the bundle's settings file. | ||
- run: databricks bundle deploy | ||
working-directory: . | ||
env: | ||
DATABRICKS_CLIENT_ID: ${{ secrets.DATABRICKS_CLIENT_ID }} | ||
DATABRICKS_CLIENT_SECRET: ${{ secrets.DATABRICKS_CLIENT_SECRET }} | ||
DATABRICKS_BUNDLE_ENV: dev | ||
|
||
# Validate, deploy, and then run the bundle. | ||
pipeline_update: | ||
name: "Run pipeline update" | ||
runs-on: ubuntu-latest | ||
|
||
# Run the "deploy" job first. | ||
needs: | ||
- deploy | ||
|
||
steps: | ||
# Check out this repo, so that this workflow can access it. | ||
- uses: actions/checkout@v3 | ||
|
||
# Use the downloaded Databricks CLI. | ||
- uses: databricks/setup-cli@main | ||
|
||
# Run the Databricks workflow named "my-job" as defined in the | ||
# bundle that was just deployed. | ||
- run: databricks bundle run my-job --refresh-all | ||
working-directory: . | ||
env: | ||
DATABRICKS_CLIENT_ID: ${{ secrets.DATABRICKS_CLIENT_ID }} | ||
DATABRICKS_CLIENT_SECRET: ${{ secrets.DATABRICKS_CLIENT_SECRET }} | ||
DATABRICKS_BUNDLE_ENV: dev |