1- # Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
2- # More GitHub Actions for Azure: https://github.com/Azure/actions
3-
4- name : Build and deploy ASP.Net Core app to Azure Web App - bulma-blazorexpress
1+ name : WebApp (Blazor Server)
52
63on :
74 push :
85 branches :
96 - main
107 workflow_dispatch :
8+ inputs :
9+ prod_release :
10+ description : ' Do you want to release to production?'
11+ required : true
12+ default : false
13+ type : boolean
1114
1215jobs :
1316 build :
@@ -22,12 +25,13 @@ jobs:
2225 uses : actions/setup-dotnet@v4
2326 with :
2427 dotnet-version : ' 9.x'
28+ include-prerelease : false
2529
2630 - name : Build with dotnet
27- run : dotnet build --configuration Release
31+ run : dotnet build ./BlazorExpress.Bulma.Demo.Server/BlazorExpress.Bulma.Demo.Server.csproj --configuration Release
2832
2933 - name : dotnet publish
30- run : dotnet publish -c Release -o "${{env.DOTNET_ROOT}}/myapp"
34+ run : dotnet publish ./BlazorExpress.Bulma.Demo.Server/BlazorExpress.Bulma.Demo.Server.csproj -c Release -o "${{env.DOTNET_ROOT}}/myapp"
3135
3236 - name : Upload artifact for deployment job
3337 uses : actions/upload-artifact@v4
@@ -37,23 +41,24 @@ jobs:
3741
3842 deploy :
3943 runs-on : windows-latest
44+ if : ${{ inputs.prod_release }}
4045 needs : build
41- permissions :
42- id-token : write # This is required for requesting the JWT
43- contents : read # This is required for actions/checkout
46+ permissions :
47+ id-token : write # This is required for requesting the JWT
48+ contents : read # This is required for actions/checkout
4449
4550 steps :
4651 - name : Download artifact from build job
4752 uses : actions/download-artifact@v4
4853 with :
4954 name : .net-app
50-
51- - name : Login to Azure
52- uses : azure/login@v2
53- with :
54- client-id : ${{ secrets.AZUREAPPSERVICE_CLIENTID_EE30BC18ACB8455EA02CF2B3AE4234A4 }}
55- tenant-id : ${{ secrets.AZUREAPPSERVICE_TENANTID_B00A222B2DC94C8AA6B8C1AC64A5DA9B }}
56- subscription-id : ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_21D06FCB7150414C8389095C3815CA30 }}
55+
56+ - name : Login to Azure
57+ uses : azure/login@v2
58+ with :
59+ client-id : ${{ secrets.AZUREAPPSERVICE_CLIENTID_EE30BC18ACB8455EA02CF2B3AE4234A4 }}
60+ tenant-id : ${{ secrets.AZUREAPPSERVICE_TENANTID_B00A222B2DC94C8AA6B8C1AC64A5DA9B }}
61+ subscription-id : ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_21D06FCB7150414C8389095C3815CA30 }}
5762
5863 - name : Deploy to Azure Web App
5964 id : deploy-to-webapp
6267 app-name : ' bulma-blazorexpress'
6368 slot-name : ' Production'
6469 package : .
65-
70+
0 commit comments