-
Notifications
You must be signed in to change notification settings - Fork 15
49 lines (43 loc) · 1.36 KB
/
demo-2.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
name: Demo 2 - CI and CD
on:
push:
branches: [disabled]
jobs:
build:
runs-on: windows-latest #He cambiado el runner. Hay tres disponibles
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
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --no-restore --verbosity normal
#Añado el uso de artefactos
- name: Publish the code
run: dotnet publish -c Release -o ${{ env.DOTNET_ROOT }}/webapp
working-directory: ./LemoncodeWeb
- name: Upload artifact
uses: actions/upload-artifact@v1
with:
name: webapp-artifact
path: ${{ env.DOTNET_ROOT }}/webapp
deploy:
runs-on: windows-latest
needs: [build] #Hay que esperar a que termine el job llamado build
steps:
- name: Download artifact
uses: actions/[email protected]
with:
name: webapp-artifact
path: ${{ env.DOTNET_ROOT }}/webapp
- name: Deploy to Azure Web App
uses: azure/webapps-deploy@v1
with:
slot-name: 'producction'
package: ${{ env.DOTNET_ROOT }}/webapp
publish-profile: ${{ secrets.WebAppPublishProfile }}