Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save isdaniel/d4e3f2039b8a3728b2aedafa05c5678f to your computer and use it in GitHub Desktop.

Select an option

Save isdaniel/d4e3f2039b8a3728b2aedafa05c5678f to your computer and use it in GitHub Desktop.
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/[email protected]
- 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/[email protected]
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