-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (78 loc) · 2.82 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
89
90
91
92
93
name: Deploy Database
on:
push:
branches: [main, release]
workflow_dispatch:
permissions:
id-token: write
contents: read
jobs:
deploy:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
target:
- name: "dev"
ref: "refs/heads/main"
client-id: "a23b30b8-3faa-42a1-817e-6cd097a620f1"
server: "sql-radix-vulnerability-scan-dev.database.windows.net"
- name: "playground"
ref: "refs/heads/release"
client-id: "453fb3de-daaa-43e6-93ef-a470849a2b6b"
server: "sql-radix-vulnerability-scan-playground.database.windows.net"
- name: "platform"
ref: "refs/heads/release"
client-id: "50e78187-ff60-49c5-bcbe-701bbbf4f5d7"
server: "sql-radix-vulnerability-scan-prod.database.windows.net"
- name: "c2"
ref: "refs/heads/release"
client-id: "f26240e2-3095-4273-8559-2ca9a121991e"
server: "sql-radix-vulnerability-scan-c2.database.windows.net"
env:
connection: >-
Server=${{matrix.target.server}};
Initial Catalog=radix-vulnerability-scan;
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@v1
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/[email protected]
if: matrix.target.ref == github.ref
with:
connection-string: ${{env.connection}}
path: './azure-infrastructure/sql-scripts/predeploy.sql'
- uses: azure/[email protected]
if: matrix.target.ref == github.ref
with:
connection-string: ${{env.connection}}
path: './azure-infrastructure/sql-scripts/roles.sql'
- uses: azure/[email protected]
if: matrix.target.ref == github.ref
with:
connection-string: ${{env.connection}}
path: './azure-infrastructure/sql-scripts/types.sql'
- uses: azure/[email protected]
if: matrix.target.ref == github.ref
with:
connection-string: ${{env.connection}}
path: './azure-infrastructure/sql-scripts/tables.sql'
- uses: azure/[email protected]
if: matrix.target.ref == github.ref
with:
connection-string: ${{env.connection}}
path: './azure-infrastructure/sql-scripts/views.sql'
- uses: azure/[email protected]
if: matrix.target.ref == github.ref
with:
connection-string: ${{env.connection}}
path: './azure-infrastructure/sql-scripts/procedures.sql'