-
Notifications
You must be signed in to change notification settings - Fork 1
89 lines (74 loc) · 2.88 KB
/
databricks-bundle.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# Reusable GitHub Actions workflow for Databricks Asset Bundles.
# Refs:
# - https://learn.microsoft.com/en-us/azure/databricks/dev-tools/bundles/
# - https://learn.microsoft.com/nb-no/azure/databricks/dev-tools/bundles/ci-cd-bundles
name: ♻ databricks-bundle
on:
workflow_call:
inputs:
runs_on:
description: The label of the runner (GitHub- or self-hosted) to run this workflow on. Defaults to `ubuntu-24.04`.
type: string
required: false
default: ubuntu-24.04
environment:
description: The target GitHub environment that the jobs in this workflow should reference.
required: true
type: string
cli_version:
description: A version of the Databricks CLI to install. Defaults to latest.
type: string
required: false
working_directory:
description: The working directory to run the Databricks commands in. Must contain a [Databricks Asset Bundle configuration](https://docs.databricks.com/aws/en/dev-tools/bundles/settings) file `databricks.yml`.
type: string
required: false
default: "."
target:
description: The bundle target to use. Must be a deployment target defined in the `databricks.yml` file.
type: string
required: false
secrets:
AZURE_CLIENT_ID:
description: The client ID of the service principal to use for authenticating to Azure.
required: true
AZURE_SUBSCRIPTION_ID:
description: The ID of the Azure subscription to authenticate to.
required: true
AZURE_TENANT_ID:
description: The ID of the Microsoft Entra tenant to authenticate to.
required: true
permissions: {}
jobs:
databricks-bundle:
name: Databricks Bundle
runs-on: ${{ inputs.runs_on }}
environment: ${{ inputs.environment }}
concurrency:
group: databricks-bundle @ ${{ inputs.environment }}
cancel-in-progress: false
permissions:
contents: read # Required by actions/checkout.
id-token: write # Required by azure/login.
defaults:
run:
working-directory: ${{ inputs.working_directory }}
env:
DATABRICKS_BUNDLE_ENV: ${{ inputs.target }}
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Setup Databricks CLI
uses: databricks/setup-cli@0885facdeaca4b97a1b35cb923abc7717e8519db
with:
version: ${{ inputs.cli_version }}
- name: Login to Azure
uses: azure/login@a65d910e8af852a8061c627c456678983e180302
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
- name: Validate Databricks bundle
run: databricks bundle validate
- name: Deploy Databricks bundle
run: databricks bundle deploy