-
Notifications
You must be signed in to change notification settings - Fork 199
92 lines (80 loc) · 2.62 KB
/
pr_check_webapp_dotnet_windows.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: pr_check_webapp_dotnet_windows
on:
push:
branches:
- master
- releases/*
paths-ignore:
- '**.md'
pull_request:
branches:
- master
- 'releases/*'
permissions:
id-token: write
# CONFIGURATION
# For help, go to https://github.com/Azure/Actions
#
# 1. Set up the following secrets in your repository:
# AZURE_WEBAPP_PUBLISH_PROFILE
#
# 2. Change these variables for your configuration:
env:
AZURE_WEBAPP_NAME: dotnetwebappdeploy # set this to your application's name
AZURE_WEBAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root
NUGET_VERSION: '5.3.1' # set this to the node version to use
jobs:
run-integration-test:
environment: automation test
name: Validate PR
strategy:
matrix:
os: [windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/checkout@master
with:
repository: Azure-Samples/dotnet-sample
ref: master
path: 'dotnetsample'
- name: Install Nuget
uses: nuget/setup-nuget@v1
with:
nuget-version: ${{ env.NUGET_VERSION}}
- name: NuGet to restore dependencies as well as project-specific tools that are specified in the project file
run: |
pwd
cd dotnetsample
nuget restore
- name: Add msbuild to PATH
uses: microsoft/[email protected]
- name: Run MSBuild
run: msbuild .\dotnetsample\SampleWebApplication.sln
- uses: actions/checkout@v2
name: Checkout from PR branch
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
path: 'webapps-deploy'
ref: ${{ github.event.pull_request.head.sha }}
- name: Installing dependencies and building latest changes
run: |
cd webapps-deploy
if (-NOT(TEST-PATH node_modules))
{
npm install
npm run build
}
- name: Azure authentication
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 WebApp'
uses: ./webapps-deploy/
with:
app-name: ${{ env.AZURE_WEBAPP_NAME }} # Replace with your app name
#publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} # Define secret variable in repository settings as per action documentation
package: 'D:\a\webapps-deploy\webapps-deploy\dotnetsample\SampleWebApplication\'