Forked from CalvinAllen/dotnet-framework-build-action.yml
Created
June 14, 2021 02:22
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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