-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (39 loc) · 1.21 KB
/
Copy pathdeploy-backend.yml
File metadata and controls
49 lines (39 loc) · 1.21 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
name: Deploy Backend
on:
push:
branches: [master]
paths:
- 'backend/**'
- '.github/workflows/deploy-backend.yml'
workflow_dispatch:
permissions:
id-token: write
contents: read
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Restore
run: dotnet restore backend/MerryTime.sln
- name: Build
run: dotnet build backend/MerryTime.sln --configuration Release --no-restore
- name: Test
run: dotnet test backend/MerryTime.sln --configuration Release --no-build
- name: Publish
run: dotnet publish backend/src/MerryTime.Api/MerryTime.Api.csproj --configuration Release --output ./publish
- name: Login to Azure
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 App Service
uses: azure/webapps-deploy@v3
with:
app-name: merrytime-api
package: ./publish