Skip to content

Commit 88e9d5f

Browse files
committed
Add GitHub Actions workflow to deploy API to Azure App Service
1 parent 3a07ed0 commit 88e9d5f

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

.github/workflows/deploy-api.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Deploy API to Azure
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'src/**'
8+
- '!src/fitspec-ui/**'
9+
10+
jobs:
11+
deploy:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- uses: actions/setup-dotnet@v4
17+
with:
18+
dotnet-version: '10.0.x'
19+
20+
- name: Restore
21+
run: dotnet restore src/FitSpec.API/FitSpec.API.csproj
22+
23+
- name: Build
24+
run: dotnet build src/FitSpec.API/FitSpec.API.csproj --configuration Release --no-restore
25+
26+
- name: Publish
27+
run: dotnet publish src/FitSpec.API/FitSpec.API.csproj --configuration Release --no-build --output ./publish
28+
29+
- name: Deploy to Azure App Service
30+
uses: azure/webapps-deploy@v3
31+
with:
32+
app-name: fitspec-api
33+
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
34+
package: ./publish

0 commit comments

Comments
 (0)