-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (73 loc) · 2.65 KB
/
deploy-database.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
name: Deploy Database
on:
push:
branches: [master, release]
workflow_dispatch:
permissions:
id-token: write
jobs:
deploy:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
target:
- name: "dev"
ref: "refs/heads/master"
client-id: "8dcdedf9-b297-4c00-864a-ea52e7ec8732"
server: "sql-radix-cost-allocation-dev.database.windows.net"
- name: "playground"
ref: "refs/heads/release"
client-id: "12038969-a194-423c-8ff8-d8dc200c0d79"
server: "sql-radix-cost-allocation-playground.database.windows.net"
- name: "platform"
ref: "refs/heads/release"
client-id: "5dd06410-a4dd-4616-8fda-090d23b1528c"
server: "sql-radix-cost-allocation-platform.database.windows.net"
- name: "c2"
ref: "refs/heads/release"
client-id: "820a9ea1-9d2f-4056-9271-d2865cc70fb6"
server: "sql-radix-cost-allocation-c2.database.windows.net"
env:
connection: >-
Server=${{matrix.target.server}};
Initial Catalog=sqldb-radix-cost-allocation;
Authentication=Active Directory Default;
Encrypt=True;
TrustServerCertificate=False;
Connection Timeout=30;
steps:
- uses: actions/checkout@v4
if: matrix.target.ref == github.ref
- uses: azure/login@v2
if: matrix.target.ref == github.ref
with:
client-id: ${{matrix.target.client-id}}
tenant-id: "3aa4a235-b6e2-48d5-9195-7fcf05b459b0"
allow-no-subscriptions: true
- uses: azure/sql-action@v2.3
if: matrix.target.ref == github.ref
with:
connection-string: ${{env.connection}}
path: './azure-infrastructure/preDeployScript.sql'
- uses: azure/sql-action@v2.3
if: matrix.target.ref == github.ref
with:
connection-string: ${{env.connection}}
path: './azure-infrastructure/createSchema.sql'
arguments: '-v RADIX_ZONE=${{matrix.target.name}}'
- uses: azure/sql-action@v2.3
if: matrix.target.ref == github.ref
with:
connection-string: ${{env.connection}}
path: './azure-infrastructure/createTables.sql'
- uses: azure/sql-action@v2.3
if: matrix.target.ref == github.ref
with:
connection-string: ${{env.connection}}
path: './azure-infrastructure/createTypes.sql'
- uses: azure/sql-action@v2.3
if: matrix.target.ref == github.ref
with:
connection-string: ${{env.connection}}
path: './azure-infrastructure/createProcedures.sql'