|
1 | 1 | # Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy |
2 | 2 | # More GitHub Actions for Azure: https://github.com/Azure/actions |
3 | 3 |
|
4 | | -name: Build and deploy ASP.NET Core app to Azure Web App - AuralizeBlazor |
| 4 | +name: Build and deploy ASP.Net Core app to Azure Web App - AuralizeBlazor |
5 | 5 |
|
6 | 6 | on: |
7 | 7 | push: |
8 | 8 | branches: |
9 | 9 | - master |
10 | 10 | workflow_dispatch: |
11 | 11 |
|
12 | | -env: |
13 | | - PROJECT_PATH: Sample/AuralizeBlazor.Sample/AuralizeBlazor.Sample.csproj |
14 | | - PUBLISH_DIR: ${{ runner.temp }}/publish |
15 | | - |
16 | 12 | jobs: |
17 | 13 | build: |
18 | 14 | runs-on: windows-latest |
19 | 15 | permissions: |
20 | | - contents: read |
| 16 | + contents: read #This is required for actions/checkout |
21 | 17 |
|
22 | 18 | steps: |
23 | | - - name: Checkout |
24 | | - uses: actions/checkout@v4 |
| 19 | + - uses: actions/checkout@v4 |
25 | 20 |
|
26 | | - - name: Set up .NET SDK |
| 21 | + - name: Set up .NET Core |
27 | 22 | uses: actions/setup-dotnet@v4 |
28 | | - with: |
29 | | - dotnet-version: '8.0.x' |
| 23 | + with: |
| 24 | + dotnet-version: '8.0.x' |
30 | 25 |
|
31 | 26 | - name: Restore |
32 | | - run: dotnet restore "${{ env.PROJECT_PATH }}" |
| 27 | + run: dotnet restore "Sample/AuralizeBlazor.Sample/AuralizeBlazor.Sample.csproj" |
33 | 28 |
|
34 | | - - name: Build (Release) |
35 | | - run: dotnet build "${{ env.PROJECT_PATH }}" --configuration Release --no-restore |
| 29 | + - name: Build with dotnet |
| 30 | + run: dotnet build "Sample/AuralizeBlazor.Sample/AuralizeBlazor.Sample.csproj" --configuration Release --no-restore |
36 | 31 |
|
37 | | - - name: Publish |
38 | | - run: dotnet publish "${{ env.PROJECT_PATH }}" -c Release -o "${{ env.PUBLISH_DIR }}" --no-build |
| 32 | + - name: dotnet publish |
| 33 | + run: dotnet publish "Sample/AuralizeBlazor.Sample/AuralizeBlazor.Sample.csproj" -c Release -o "./publish" --no-build |
39 | 34 |
|
40 | | - - name: Upload artifact for deployment |
| 35 | + - name: Upload artifact for deployment job |
41 | 36 | uses: actions/upload-artifact@v4 |
42 | 37 | with: |
43 | | - name: dotnet-publish |
44 | | - path: ${{ env.PUBLISH_DIR }} |
| 38 | + name: .net-app |
| 39 | + path: ./publish |
45 | 40 |
|
46 | 41 | deploy: |
47 | 42 | runs-on: windows-latest |
48 | 43 | needs: build |
49 | 44 | permissions: |
50 | | - id-token: write |
51 | | - contents: read |
| 45 | + id-token: write #This is required for requesting the JWT |
| 46 | + contents: read #This is required for actions/checkout |
52 | 47 |
|
53 | 48 | steps: |
54 | | - - name: Download build artifact |
| 49 | + - name: Download artifact from build job |
55 | 50 | uses: actions/download-artifact@v4 |
56 | 51 | with: |
57 | | - name: dotnet-publish |
| 52 | + name: .net-app |
58 | 53 | path: ./publish |
59 | | - |
60 | | - - name: Login to Azure (OIDC) |
| 54 | + |
| 55 | + - name: Login to Azure |
61 | 56 | uses: azure/login@v2 |
62 | 57 | with: |
63 | 58 | client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_5966A2E7DF5A439C8FF34EA3A3FEA2F7 }} |
64 | 59 | tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_42FDABC6DA9F44E598B049B87B6EA726 }} |
65 | 60 | subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_098A55B73585475DB51124C1729752A8 }} |
66 | 61 |
|
67 | 62 | - name: Deploy to Azure Web App |
| 63 | + id: deploy-to-webapp |
68 | 64 | uses: azure/webapps-deploy@v3 |
69 | 65 | with: |
70 | 66 | app-name: 'AuralizeBlazor' |
|
0 commit comments