-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (30 loc) · 1.08 KB
/
main.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
name: Deploy Eshop API 🚀
on:
workflow_dispatch:
push:
branches:
- main
env:
AZURE_WEBAPP_NAME: "eshop-clean-architecture"
AZURE_WEBAPP_PACKAGE_PATH: "./publish"
jobs:
publish:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Install dependencies
run: dotnet restore ./src/API/CleanArchitecture.Api/CleanArchitecture.Api.csproj
- name: Buid
run: dotnet build ./src/API/CleanArchitecture.Api/CleanArchitecture.Api.csproj --configuration Release --no-restore
- name: Publish
run: dotnet publish ./src/API/CleanArchitecture.Api/CleanArchitecture.Api.csproj --configuration Release --output '${{ env.AZURE_WEBAPP_PACKAGE_PATH }}'
- name: Deploy to Azure Web App
uses: azure/webapps-deploy@v2
with:
app-name: ${{ env.AZURE_WEBAPP_NAME }}
publish-profile: ${{ secrets.API_PUBLISH_SECRET }}
package: "${{ env.AZURE_WEBAPP_PACKAGE_PATH }}"