Skip to content

Commit f24e1e4

Browse files
committed
Add deployment steps for Azure Web App in CI workflow
1 parent 7a7d77a commit f24e1e4

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

.github/workflows/api.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,30 @@ jobs:
2424
run: dotnet build --no-restore
2525
- name: Test
2626
run: dotnet test --no-build --verbosity normal
27+
- name: dotnet publish
28+
run: dotnet publish UrlShortener.Api -c Release -o ${{env.DOTNET_ROOT}}/myapp
29+
- name: Upload artifact for deployment job
30+
uses: actions/upload-artifact@v4
31+
with:
32+
name: .net-app
33+
path: ${{env.DOTNET_ROOT}}/myapp
34+
35+
36+
deploy-dev:
37+
runs-on: ubuntu-latest
38+
needs: build
39+
environment: Development
40+
41+
steps:
42+
- name: Download artifact from build job
43+
uses: actions/download-artifact@v4
44+
with:
45+
name: .net-app
46+
47+
- name: Deploy to Azure Web App
48+
uses: azure/webapps-deploy@v3
49+
with:
50+
app-name: ${{ vars.API_RESOURCE_NAME }}
51+
slot-name: 'production'
52+
publish-profile: ${{ secrets.AZURE_API_PUBLISH_PROFILE }}
53+
package: ${{ github.workspace }}/.net-app

0 commit comments

Comments
 (0)