Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A GitHub Action to build a .NET Framework Web Application and Deploy it to Azure
name: EZRep Build
on:
push:
branches: master
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1
- name: Setup NuGet
uses: NuGet/setup-nuget@v1.0.2
- name: Navigate to Workspace
run: cd $GITHUB_WORKSPACE
- name: Create Build Directory
run: mkdir _build
- name: Restore Packages
run: nuget restore EzRep.sln
- name: Build Solution
run: |
msbuild.exe EzRep.sln /nologo /nr:false /p:DeployOnBuild=true /p:DeployDefaultTarget=WebPublish /p:WebPublishMethod=FileSystem /p:DeleteExistingFiles=True /p:platform="Any CPU" /p:configuration="Release" /p:PublishUrl="../_build"
- name: Upload artifact
uses: actions/upload-artifact@v1.0.0
with:
name: EZRepBundle
path: "./_build"
- name: Login to Azure
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Publish Artifacts to Azure
uses: Azure/webapps-deploy@v2
with:
app-name: ezrep
package: "./_build"
slot-name: production
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.