-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (44 loc) · 1.32 KB
/
deployWebApp.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
name: Deploy ASP.NET Core app to Azure Web App
on:
push:
branches:
- mainnowayjose
paths:
- '**/MVCProtectingSecrets/*'
workflow_dispatch:
permissions:
id-token: write
contents: read
env:
DOTNET_VERSION: '6.x'
jobs:
build-and-deploy-dev:
runs-on: ubuntu-latest
environment:
name: 'dev'
defaults:
run:
working-directory: ./resources/Starter/MVCProtectingSecrets
steps:
- uses: actions/checkout@v4
- name: Set up .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Build with dotnet
run: dotnet build --configuration Release
- name: dotnet publish
run: dotnet publish -c Release -o ${{env.DOTNET_ROOT}}/myapp
- name: Login to Azure
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Deploy to Azure Web App
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
with:
app-name: ${{ vars.APP_NAME }}
slot-name: ${{ vars.SLOT_NAME }}
package: ${{ env.DOTNET_ROOT }}/myapp