feature: action and build workflow

This commit is contained in:
Fernando de Oliveira 2021-09-15 17:08:00 -03:00
Родитель 1c34264743
Коммит 58af8a1ab1
2 изменённых файлов: 56 добавлений и 0 удалений

18
action.yml Normal file
Просмотреть файл

@ -0,0 +1,18 @@
name: Bicep Build
description: Build an ARM template from Bicep main file
inputs:
bicepFilePath:
description: Bicep main file path
required: true
default: ./main.bicep
outputFilePath:
description: ARM template output path
required: false
default: ./azuredeploy.json
runs:
using: composite
steps:
- run: az bicep build --file ${{ inputs.bicepFilePath }} --outfile ${{ inputs.outputFilePath }}
shell: bash

38
samples/main.bicep Normal file
Просмотреть файл

@ -0,0 +1,38 @@
@minLength(3)
@maxLength(24)
param storageName string
resource virtualNetwork 'Microsoft.Network/virtualNetworks@2019-11-01' = {
name: 'examplevnet'
location: resourceGroup().location
properties: {
addressSpace: {
addressPrefixes: [
'10.0.0.0/16'
]
}
subnets: [
{
name: 'Subnet-1'
properties: {
addressPrefix: '10.0.0.0/24'
}
}
{
name: 'Subnet-2'
properties: {
addressPrefix: '10.0.1.0/24'
}
}
]
}
}
resource exampleStorage 'Microsoft.Storage/storageAccounts@2021-02-01' = {
name: storageName
location: 'eastus'
sku: {
name: 'Standard_LRS'
}
kind: 'StorageV2'
}