-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup Azure infrastructure with Bicep and GitHub Actions
- Loading branch information
Showing
4 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Deploy Infrastructure | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
deploy_infra: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Login to Azure | ||
uses: azure/login@v1 | ||
with: | ||
creds: ${{ secrets.AZURE_CREDENTIALS }} | ||
|
||
- name: Deploy Bicep files | ||
run: | | ||
az deployment group create --resource-group ${{ secrets.AZURE_RESOURCE_GROUP }} --template-file ./infra/main.bicep --parameters appServiceName=${{ secrets.APP_SERVICE_NAME }} storageAccountName=${{ secrets.STORAGE_ACCOUNT_NAME }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
param appServiceName string | ||
param location string = 'eastus' | ||
param appServicePlanId string | ||
|
||
resource appService 'Microsoft.Web/sites@2021-02-01' = { | ||
name: appServiceName | ||
location: location | ||
kind: 'app' | ||
properties: { | ||
serverFarmId: appServicePlanId | ||
httpsOnly: true | ||
} | ||
siteConfig: { | ||
appSettings: [ | ||
{ | ||
name: 'WEBSITE_NODE_DEFAULT_VERSION' | ||
value: '10.14.1' | ||
} | ||
] | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
targetScope = 'resourceGroup' | ||
|
||
resource appService 'Microsoft.Web/sites@2021-02-01' = { | ||
name: 'appServiceName' | ||
location: 'location' | ||
properties: { | ||
serverFarmId: 'appServicePlanId' | ||
} | ||
} | ||
|
||
resource storageAccount 'Microsoft.Storage/storageAccounts@2021-04-01' = { | ||
name: 'storageAccountName' | ||
location: 'location' | ||
kind: 'StorageV2' | ||
sku: { | ||
name: 'Standard_LRS' | ||
} | ||
properties: { | ||
accessTier: 'Hot' | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
param storageAccountName string | ||
param location string = 'eastus' | ||
|
||
resource storageAccount 'Microsoft.Storage/storageAccounts@2021-04-01' = { | ||
name: storageAccountName | ||
location: location | ||
kind: 'StorageV2' | ||
sku: { | ||
name: 'Standard_LRS' | ||
} | ||
properties: { | ||
accessTier: 'Hot' | ||
} | ||
} |