Skip to content

Instantly share code, notes, and snippets.

@beachside-project
Last active December 16, 2022 07:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beachside-project/65c3add5da881fd4066d169addb14732 to your computer and use it in GitHub Desktop.
Save beachside-project/65c3add5da881fd4066d169addb14732 to your computer and use it in GitHub Desktop.
ASP.NET MVC (.NET Framework 4.8) to App Service
name: ASP.NET MVC (.NET Framework 4.8) to App Service
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
jobs:
build:
runs-on: windows-latest
defaults:
run:
working-directory: aspnet-mvc-dotnetframework48
steps:
- uses: actions/checkout@v3
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1
- name: Setup NuGet
uses: nuget/setup-nuget@v1
- name: Restore NuGet packages
run: nuget restore AspnetMvc48.sln
- name: Build
run: msbuild AspnetMvc48.sln /p:Configuration=Release /p:DeployOnBuild=true /p:DeployDefaultTarget=WebPublish /p:WebPublishMethod=FileSystem /p:publishUrl=${{ github.workspace }}\publish /p:PrecompileBeforePublish=true /p:EnableUpdateable=false
- name: Zip
run: compress-archive ${{ github.workspace }}\publish\* ${{ github.workspace }}\app.zip
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: app
path: ${{ github.workspace }}\app.zip
deploy:
needs: build
runs-on: windows-latest
steps:
- name: Download app
uses: actions/download-artifact@v3
with:
name: app
- name: Deploy to App Service
uses: azure/webapps-deploy@v2
with:
app-name: "app-eru-netframework-mvc"
publish-profile: ${{ secrets.AZURE_APP_SERVICE_PUBLISH_PROFILE }}
package: ${{ github.workspace }}\app.zip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment