-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (48 loc) · 1.76 KB
/
azuredeploy.arm.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
57
name: Azure Resource Manager Provision and Deploy
on: workflow_dispatch
jobs:
#====== Provision and Deploy ======#
provision_and_deploy:
name: "Provision and Deploy"
runs-on: ubuntu-latest
steps:
# Checkout repository
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
# Login to Azure
- name: Login to Azure
uses: azure/login@v2
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
# Deploy ARM template
- name: Deploy ARM Template
uses: azure/arm-deploy@v2
with:
subscriptionId: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
resourceGroupName: ${{ vars.RESOURCE_GROUP_NAME }}
template: ./infra/azuredeploy.json
deploymentMode: Incremental
parameters: staticSites_name=${{ vars.STATIC_WEB_APP_NAME }}
# Get Azure Static Web App deployment token
- name: Get Azure Static Web App deployment token
id: get-token
run: |
TOKEN=$(az staticwebapp secrets list --name ${{ vars.STATIC_WEB_APP_NAME }} --resource-group ${{ vars.RESOURCE_GROUP_NAME }} --query "properties.apiKey" -o tsv)
echo "STATIC_WEB_APP_TOKEN=$TOKEN" >> $GITHUB_ENV
# Deploy to Azure Static Web Apps
- name: Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ env.STATIC_WEB_APP_TOKEN }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
action: 'upload'
app_location: '/src/Blazor.WebAssembly'
output_location: 'wwwroot'
app_build_command: 'dotnet publish -c Release'
# Logout of Azure
- name: Logout of Azure
run: |
az logout