forked from Azure/data-management-zone
-
Notifications
You must be signed in to change notification settings - Fork 0
122 lines (108 loc) · 3.81 KB
/
dataManagementZoneDeployment.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: Data Management Zone Deployment
on:
push:
branches: [main]
paths:
- "infra/**"
- "code/**"
- ".github/workflows/dataManagementZoneDeployment.yml"
pull_request:
branches: [main]
paths:
- "infra/**"
- "code/**"
- ".github/workflows/dataManagementZoneDeployment.yml"
env:
AZURE_SUBSCRIPTION_ID: "17588eb2-2943-461a-ab3f-00a3ceac3112" # Update to '{dataHubSubscriptionId}'
AZURE_LOCATION: "northeurope" # Update to '{regionName}'
jobs:
validation:
name: "Validation of IaC templates"
runs-on: ubuntu-latest
continue-on-error: false
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Check Out Repository
id: checkout_repository
uses: actions/checkout@v2
# Login to Azure
- name: Azure Login
id: azure_login
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
# Deploy Data Management Zone - validation
- name: Deploy Data Management Zone - validation
id: data_management_zone_validation
uses: azure/arm-deploy@v1
with:
scope: subscription
subscriptionId: ${{ env.AZURE_SUBSCRIPTION_ID }}
region: ${{ env.AZURE_LOCATION }}
template: ${{ github.workspace }}/infra/main.json
parameters: ${{ github.workspace }}/infra/params.dev.json
deploymentMode: Validate
failOnStdErr: false
# Deploy Data Management Zone - what-if
- name: Deploy Data Management Zone - what-if
id: data_management_zone_whatif
uses: azure/CLI@v1
with:
azcliversion: "agentazcliversion"
inlineScript: |
az account set \
--subscription ${{ env.AZURE_SUBSCRIPTION_ID }}
az deployment sub what-if \
--location ${{ env.AZURE_LOCATION }} \
--subscription ${{ env.AZURE_SUBSCRIPTION_ID }} \
--exclude-change-types Ignore NoChange Unsupported \
--template-file "${GITHUB_WORKSPACE}/infra/main.json" \
--parameters "${GITHUB_WORKSPACE}/infra/params.dev.json" \
--result-format "FullResourcePayloads"
# Log out from Azure
- name: Log out from Azure
id: azure_logout
uses: azure/cli@v1
with:
azcliversion: "agentazcliversion"
inlineScript: |
az logout
deployment:
name: "Deployment of IaC templates"
needs: [validation]
runs-on: ubuntu-latest
if: github.event_name == 'push'
continue-on-error: false
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Check Out Repository
id: checkout_repository
uses: actions/checkout@v2
# Login to Azure
- name: Azure Login
id: azure_login
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
enable-AzPSSession: true
# Deploy Data Management Zone
- name: Deploy Data Management Zone
id: data_management_zone_deployment
uses: azure/arm-deploy@v1
with:
scope: subscription
subscriptionId: ${{ env.AZURE_SUBSCRIPTION_ID }}
region: ${{ env.AZURE_LOCATION }}
template: ${{ github.workspace }}/infra/main.json
parameters: ${{ github.workspace }}/infra/params.dev.json
deploymentMode: Incremental
failOnStdErr: false
# Log out from Azure
- name: Log out from Azure
id: azure_logout
uses: azure/cli@v1
with:
azcliversion: "agentazcliversion"
inlineScript: |
az logout