Skip to content

Commit

Permalink
Create .net.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
RaviAkshintala authored Jan 31, 2025
1 parent c8b6f67 commit 83ac0b4
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/.net.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Deploy .NET 8 Application

on: [push, pull_request]

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --configuration Release --no-restore

- name: Publish
run: dotnet publish --configuration Release --output ./output

- name: Deploy to Azure Web App
uses: azure/webapps-deploy@v2
with:
app-name: test
slot-name: production
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
package: ./output

- name: Install NuGet
run: dotnet tool install --global NuGet.CommandLine

- name: Pack NuGet package
run: dotnet pack -c Release

- name: Push NuGet package
run: dotnet nuget push ./output/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json

0 comments on commit 83ac0b4

Please sign in to comment.