Skip to content

Deploy ASP.NET Core app to Azure Web App #1

Deploy ASP.NET Core app to Azure Web App

Deploy ASP.NET Core app to Azure Web App #1

Workflow file for this run

name: Deploy ASP.NET Core app to Azure Web App
on:
push:
branches:
- mainnowayjose
paths:
- '**/MVCProtectingSecrets/*'
workflow_dispatch:
permissions:
id-token: write
contents: read
env:
DOTNET_VERSION: '6.x'
jobs:
build-and-deploy-dev:
runs-on: ubuntu-latest
environment:
name: 'dev'
defaults:
run:
working-directory: ./resources/Starter/MVCProtectingSecrets
steps:
- uses: actions/checkout@v4
- name: Set up .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Build with dotnet
run: dotnet build --configuration Release
- name: dotnet publish
run: dotnet publish -c Release -o ${{env.DOTNET_ROOT}}/myapp
- 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 Web App
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
with:
app-name: ${{ vars.APP_NAME }}
slot-name: ${{ vars.SLOT_NAME }}
package: ${{ env.DOTNET_ROOT }}/myapp