Merge pull request #15 from pamelafox/bicep-format
Browse files
.github/workflows/azure-bicep-validate.yaml
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
name:
|
2 |
on:
|
3 |
workflow_dispatch:
|
4 |
push:
|
@@ -13,11 +13,31 @@ on:
|
|
13 |
jobs:
|
14 |
build:
|
15 |
runs-on: ubuntu-latest
|
|
|
16 |
steps:
|
17 |
-
- name: Checkout
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
uses: actions/checkout@v2
|
19 |
|
20 |
-
- name:
|
|
|
|
|
|
|
|
|
|
|
21 |
uses: azure/CLI@v1
|
22 |
with:
|
23 |
-
inlineScript: az
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: Bicep scripts
|
2 |
on:
|
3 |
workflow_dispatch:
|
4 |
push:
|
|
|
13 |
jobs:
|
14 |
build:
|
15 |
runs-on: ubuntu-latest
|
16 |
+
|
17 |
steps:
|
18 |
+
- name: Checkout PR
|
19 |
+
if: ${{ github.event_name == 'pull_request'}}
|
20 |
+
uses: actions/checkout@v3
|
21 |
+
with:
|
22 |
+
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
23 |
+
ref: ${{ github.event.pull_request.head.ref }}
|
24 |
+
|
25 |
+
- name: Checkout branch
|
26 |
+
if: ${{ github.event_name == 'push'}}
|
27 |
uses: actions/checkout@v2
|
28 |
|
29 |
+
- name: Build Bicep
|
30 |
+
uses: azure/CLI@v1
|
31 |
+
with:
|
32 |
+
inlineScript: az bicep build -f infra/main.bicep
|
33 |
+
|
34 |
+
- name: Format Bicep
|
35 |
uses: azure/CLI@v1
|
36 |
with:
|
37 |
+
inlineScript: az bicep format -f infra/main.bicep
|
38 |
+
|
39 |
+
- name: Add updated Bicep files to commit
|
40 |
+
uses: EndBug/add-and-commit@v9
|
41 |
+
with:
|
42 |
+
message: 'Update Bicep files'
|
43 |
+
add: '*.bicep'
|
infra/main.bicep
CHANGED
@@ -20,7 +20,6 @@ param principalId string = ''
|
|
20 |
@description('Django SECRET_KEY for cryptographic signing')
|
21 |
param djangoSecretKey string
|
22 |
|
23 |
-
|
24 |
var resourceToken = toLower(uniqueString(subscription().id, name, location))
|
25 |
var tags = { 'azd-env-name': name }
|
26 |
|
@@ -53,7 +52,7 @@ module postgresServer 'core/database/postgresql/flexibleserver.bicep' = {
|
|
53 |
version: '14'
|
54 |
administratorLogin: postgresAdminUser
|
55 |
administratorLoginPassword: postgresAdminPassword
|
56 |
-
databaseNames: [postgresDatabaseName]
|
57 |
allowAzureIPsFirewall: true
|
58 |
}
|
59 |
}
|
@@ -83,7 +82,6 @@ module web 'core/host/appservice.bicep' = {
|
|
83 |
}
|
84 |
}
|
85 |
|
86 |
-
|
87 |
module appServicePlan 'core/host/appserviceplan.bicep' = {
|
88 |
name: 'serviceplan'
|
89 |
scope: resourceGroup
|
@@ -145,7 +143,6 @@ module keyVaultSecrets './core/security/keyvault-secret.bicep' = [for secret in
|
|
145 |
}
|
146 |
}]
|
147 |
|
148 |
-
|
149 |
module logAnalyticsWorkspace 'core/monitor/loganalytics.bicep' = {
|
150 |
name: 'loganalytics'
|
151 |
scope: resourceGroup
|
@@ -156,8 +153,6 @@ module logAnalyticsWorkspace 'core/monitor/loganalytics.bicep' = {
|
|
156 |
}
|
157 |
}
|
158 |
|
159 |
-
|
160 |
-
|
161 |
output WEB_URI string = 'https://${web.outputs.uri}'
|
162 |
output AZURE_LOCATION string = location
|
163 |
-
output AZURE_KEY_VAULT_NAME string = keyVault.outputs.name
|
|
|
20 |
@description('Django SECRET_KEY for cryptographic signing')
|
21 |
param djangoSecretKey string
|
22 |
|
|
|
23 |
var resourceToken = toLower(uniqueString(subscription().id, name, location))
|
24 |
var tags = { 'azd-env-name': name }
|
25 |
|
|
|
52 |
version: '14'
|
53 |
administratorLogin: postgresAdminUser
|
54 |
administratorLoginPassword: postgresAdminPassword
|
55 |
+
databaseNames: [ postgresDatabaseName ]
|
56 |
allowAzureIPsFirewall: true
|
57 |
}
|
58 |
}
|
|
|
82 |
}
|
83 |
}
|
84 |
|
|
|
85 |
module appServicePlan 'core/host/appserviceplan.bicep' = {
|
86 |
name: 'serviceplan'
|
87 |
scope: resourceGroup
|
|
|
143 |
}
|
144 |
}]
|
145 |
|
|
|
146 |
module logAnalyticsWorkspace 'core/monitor/loganalytics.bicep' = {
|
147 |
name: 'loganalytics'
|
148 |
scope: resourceGroup
|
|
|
153 |
}
|
154 |
}
|
155 |
|
|
|
|
|
156 |
output WEB_URI string = 'https://${web.outputs.uri}'
|
157 |
output AZURE_LOCATION string = location
|
158 |
+
output AZURE_KEY_VAULT_NAME string = keyVault.outputs.name
|