-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathci.yml
57 lines (47 loc) · 1.42 KB
/
ci.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
# This starter covers CI/CD for most use-cases.
# CI - On PR, run `ksd build` to ensure validity.
# CD - On push OR manual queuing, run `ksd sync` to deploy the changes.
# The following action variables should be set:
# - KUSTO_DB_ENDPOINT
# - KUSTO_SYNC_APP_CLIENT_ID
# - TENANT_ID
# The following action secrets should be set:
# - KUSTO_SYNC_APP_CLIENT_SECRET
name: kusto-ci
on:
push:
branches: [ main ]
pull_request:
workflow_dispatch:
jobs:
build:
if: ${{ github.event_name == 'pull_request'' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install ksd
run: |
wget https://github.com/weikanglim/kusto-synced/releases/latest/download/ksd_linux_x86_64.tar.gz
tar -xzf ksd_linux_x86_64.tar.gz
- name: Build
run: ./ksd build
sync:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request'' }}
steps:
- uses: actions/checkout@v3
- name: Install ksd
shell: bash
run: |
wget https://github.com/weikanglim/kusto-synced/releases/latest/download/ksd_linux_x86_64.tar.gz
tar -xzf ksd_linux_x86_64.tar.gz
- name: Sync
shell: bash
run: >
./ksd sync
--endpoint $KUSTO_DB_ENDPOINT
--client-id $KUSTO_SYNC_APP_CLIENT_ID
--tenant-id $TENANT_ID
--client-secret $CLIENT_SECRET
env:
CLIENT_SECRET: ${{ secrets.KUSTO_SYNC_APP_CLIENT_SECRET }}