GitHub Actions
Example 1: Deploy ASP.NET Core to Azure Web App
name: ASP.NET Core CI/CD with Azure
on:
push:
branches: [ main ]
env:
AZURE_WEBAPP_NAME: myapp
AZURE_WEBAPP_PACKAGE_PATH: './bin/Release/netcoreapp3.1/publish'
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: '3.1.x'
- name: Build and publish
run: dotnet build --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 }}
package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}Example 2: Deploy Azure Infrastructure with ARM Templates
Best Practices
References
Last updated