-
Notifications
You must be signed in to change notification settings - Fork 1
47 lines (45 loc) · 1.27 KB
/
webapp-cd.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
name: Azure WebApp Deploy
on:
push:
branches: [ main ]
jobs:
deploy-arm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- uses: azure/arm-deploy@v1
with:
resourceGroupName: chocrates-webdeploy
template: ./azure/azuredeploy.json
parameters: ./azure/azuredeploy.parameters.json
build:
name: Build and Deploy
runs-on: ubuntu-latest
needs: deploy-arm
steps:
- uses: actions/checkout@v2
- name: Set up dotnet Core ${{ env.NETCORE_VERSION }}
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.NETCORE_VERSION }}
- name: Restore
run: |
cd dotnet-web
dotnet restore
- name: Build
run: |
cd dotnet-web
dotnet build --no-restore
- name: Publish
run: |
cd dotnet-web
dotnet publish --configuration Release --output ${{ env.AZURE_WEBAPP_PACKAGE_NAME }}
- name: Deploy to Azure
uses: azure/webapps-deploy@v2
with:
app-name: ${{ env.AZURE_WEBAPP_NAME }}
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
package: ./published