-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (54 loc) · 1.41 KB
/
dotnet.yml
File metadata and controls
58 lines (54 loc) · 1.41 KB
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
name: .NET
on:
push:
branches:
- '**'
pull_request:
branches:
- develop
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
deploy:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
- name: Build release
run: dotnet build --configuration Release
- name: Dotnet publish
run: dotnet publish -c Release -o Studentify
- uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Update database
run: |
dotnet tool install --global dotnet-ef
dotnet tool restore
dotnet ef database update --project Studentify --connection "${{ secrets.DEFAULT_CONNECTION_STRING }}"
env:
ASPNETCORE_ENVIRONMENT: Development
- name: 'Azure deploy'
uses: azure/webapps-deploy@v1
with:
app-name: studentify20210330221435
publish-profile: ${{ secrets.PUBLISH_PROFILE }}
package: './Studentify'