Skip to content

Commit 938baa0

Browse files
committed
Updates prod deploy
1 parent 6308072 commit 938baa0

File tree

1 file changed

+17
-19
lines changed

1 file changed

+17
-19
lines changed

.github/workflows/prod.yml

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,35 @@
11
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
22
# More GitHub Actions for Azure: https://github.com/Azure/actions
33

4-
name: pwabuilder-ios to prod
4+
name: Build and deploy ASP.Net Core app to Azure Web App - pwabuilder-ios
55

66
on:
77
push:
88
branches:
99
- main
10+
workflow_dispatch:
1011

1112
jobs:
1213
build:
1314
runs-on: windows-latest
15+
permissions:
16+
contents: read
1417

1518
steps:
1619
- uses: actions/checkout@v4
17-
- uses: microsoft/variable-substitution@v1
18-
with:
19-
files: './Microsoft.PWABuilder.IOS.Web/appsettings.Production.json'
20-
env:
21-
AppSettings.ApplicationInsightsConnectionString: ${{secrets.APPLICATIONINSIGHTSCONNECTIONSTRING}}
20+
2221
- name: Set up .NET Core
23-
uses: actions/setup-dotnet@v2
22+
uses: actions/setup-dotnet@v4
2423
with:
2524
dotnet-version: '7.x'
26-
include-prerelease: true
2725

2826
- name: Build with dotnet
2927
working-directory: ./Microsoft.PWABuilder.IOS.Web
3028
run: dotnet build --configuration Release
3129

3230
- name: dotnet publish
3331
working-directory: ./Microsoft.PWABuilder.IOS.Web
34-
run: dotnet publish -c Release -o ${{env.DOTNET_ROOT}}/myapp
32+
run: dotnet publish -c Release -o "${{env.DOTNET_ROOT}}/myapp"
3533

3634
- name: Upload artifact for deployment job
3735
uses: actions/upload-artifact@v4
@@ -41,30 +39,30 @@ jobs:
4139

4240
deploy:
4341
runs-on: windows-latest
44-
permissions:
45-
id-token: write
46-
contents: read
4742
needs: build
48-
environment:
49-
name: 'pre'
50-
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
43+
44+
permissions:
45+
id-token: write #This is required for requesting the JWT
46+
contents: read #This is required for actions/checkout
5147

5248
steps:
5349
- name: Download artifact from build job
5450
uses: actions/download-artifact@v4
5551
with:
5652
name: .net-app
57-
58-
- name: Authenticate to Azure
59-
uses: azure/login@v1
53+
54+
- name: Login to Azure
55+
uses: azure/login@v2
6056
with:
6157
client-id: ${{ secrets.AZURE_APP_ID }}
6258
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
6359
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
6460

6561
- name: Deploy to Azure Web App
6662
id: deploy-to-webapp
67-
uses: azure/webapps-deploy@v2
63+
uses: azure/webapps-deploy@v3
6864
with:
6965
app-name: 'pwabuilder-ios'
66+
slot-name: 'production'
7067
package: .
68+

0 commit comments

Comments
 (0)