-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (47 loc) · 1.75 KB
/
deploy-bicep.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
# File: .github/workflows/deploy-bicep.yml
on:
workflow_dispatch:
name: Deploy Bicep code
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
actions: write
contents: write
security-events: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Azure CLI login
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Run bicep deployment
uses: azure/arm-deploy@v1
id: arm-deploy
with:
subscriptionId: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
scope: subscription
region: 'westeurope'
template: src/bicep/main.bicep
parameters: src/bicep/main.parameters.json emToken=${{ secrets.EMTOKEN }}
# - name: Install PowerShell Modules
# run: |
# Set-PSRepository PSGallery -InstallationPolicy Trusted
# New-Item -ItemType Directory -Path ./Modules
# Save-Module -Name Az.Accounts -Path ./Modules -Repository PSGallery
# Save-Module -Name Az.Resources -Path ./Modules -Repository PSGallery
# Save-Module -Name Az.Cdn -Path ./Modules -Repository PSGallery
# Save-Module -Name PSWattTime -Path ./Modules -Repository PSGallery
# shell: pwsh
# working-directory: ./src/CarbonSchedulerFunctionApp
- name: Zip azure function
run: zip -r ../../function.zip ./
shell: bash
working-directory: ./src/carbon-appinsights
- name: Deploy function code
run: |
az functionapp deployment source config-zip --src ./function.zip \
--name ${{ steps.arm-deploy.outputs.functionAppName }} \
--resource-group ${{ steps.arm-deploy.outputs.functionAppResourceGroup }} \
--subscription ${{ secrets.AZURE_SUBSCRIPTION_ID }}