-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample-cicd.yml
53 lines (49 loc) · 1.26 KB
/
example-cicd.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
name: CI/CD Pipeline
on:
push:
branches:
- main
- release
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Databricks CLI
run: |
pip install databricks-cli
databricks configure --token
- name: Run pre-deploy tests
run: |
databricks bundle validate
databricks bundle deploy -t dev
databricks bundle run -t dev pre-deploy-tests
build:
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Databricks CLI
run: |
pip install databricks-cli
databricks configure --token
- name: Build wheel file
run: |
python setup.py bdist_wheel
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Databricks CLI
run: |
pip install databricks-cli
databricks configure --token
- name: Deploy to production
if: github.ref == 'refs/heads/release'
run: |
databricks bundle deploy -t prod
databricks bundle run -t prod deploy-job