Create dotnet.yml #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ARM Template deployment using What-If | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout code | |
- uses: actions/checkout@main | |
# Log into Azure | |
- uses: azure/login@v1 | |
with: | |
creds: ${{ secrets.AZURE_CREDENTIALS }} | |
# Deploy ARM template | |
- name: Preview changes | |
uses: Azure/deployment-what-if-action@v1.0.0 | |
with: | |
subscription: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
resourceGroup: ${{ secrets.AZURE_RG }} | |
templateFile: ./storagedeploy.json | |
additionalParameters: storageAccountType=Standard_LRS | |
- name: Run ARM deploy | |
uses: azure/arm-deploy@v1 | |
with: | |
subscriptionId: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
resourceGroupName: ${{ secrets.AZURE_RG }} | |
template: ./storagedeploy.json | |
parameters: storageAccountType=Standard_LRS | |
# output containerName variable from template | |
- run: echo ${{ steps.deploy.outputs.containerName }} |