-
Notifications
You must be signed in to change notification settings - Fork 2
44 lines (38 loc) · 1.37 KB
/
dotnet-core.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
name: .NET Core
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
AZURE_WEBAPP_NAME: errorcentral # 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
DOTNET_VERSION: '3.1.201' # set this to the dot net version to use
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.101
- name: Install dependencies
run: dotnet restore
- name: Build and Publish
run: |
dotnet build --configuration Release --no-restore
dotnet test --no-restore --verbosity normal
dotnet publish -o '${{ env.AZURE_WEBAPP_PACKAGE_PATH }}/output'
- name: Upload Artifact
uses: actions/upload-artifact@v1
with:
name: artifact
path: output/
# Deploy to Azure Web apps
- name: 'Run Azure webapp deploy action using publish profile credentials'
uses: azure/webapps-deploy@v2
with:
app-name: ${{ env.AZURE_WEBAPP_NAME }} # Replace with your app name
publish-profile: ${{ secrets.ERROR_CENTRAL }} # Define secret variable in repository settings as per action documentation
package: '${{ env.AZURE_WEBAPP_PACKAGE_PATH }}/output'