Skip to content

Instantly share code, notes, and snippets.

@aflores
Created April 28, 2021 00:52
Show Gist options
  • Save aflores/b91c989cd1d1113d0937dce8236121de to your computer and use it in GitHub Desktop.
Save aflores/b91c989cd1d1113d0937dce8236121de to your computer and use it in GitHub Desktop.
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# More GitHub Actions for Azure: https://github.com/Azure/actions
name: Build and deploy ASP.Net Core app to Azure Web App - partsunlimited-web-20(staging)
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: windows-latest
steps:
- uses: actions/checkout@main
- name: Set up .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '2.2.207'
- name: Build with dotnet
run: dotnet build PartsUnlimited.sln --configuration Release
- name: dotnet publish
run: dotnet publish src/PartsUnlimitedWebsite/PartsUnlimitedWebsite.csproj -c Release -o ${{env.DOTNET_ROOT}}/myapp
- name: Deploy to Azure Web App
uses: azure/webapps-deploy@v2
with:
app-name: 'partsunlimited-web-20'
slot-name: 'staging'
publish-profile: ${{ secrets.AzureAppService_PublishProfile_a00d49c7adc84a028ccc74ff431024d5 }}
package: ${{env.DOTNET_ROOT}}/myapp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment