Merge pull request #188 from jamesmontemagno/patch-1 #16
This file contains 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: Deploy to Azure Web App | |
on: | |
push: | |
branches: | |
- master | |
env: | |
AZURE_WEBAPP_NAME: fuget | |
AZURE_WEBAPP_PACKAGE_PATH: '.' | |
DOTNET_VERSION: '5.0.x' | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
environment: dev | |
steps: | |
# Checkout the repo | |
- uses: actions/checkout@v2.3.4 | |
# Setup .NET Core SDK | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v1.8.0 | |
with: | |
dotnet-version: ${{ env.DOTNET_VERSION }} | |
# Run dotnet build and publish | |
- name: Build and publish | |
run: | | |
dotnet restore | |
dotnet build --configuration Release | |
dotnet publish -c Release -o '${{ env.AZURE_WEBAPP_PACKAGE_PATH }}/${{ env.AZURE_WEBAPP_NAME }}' | |
# Deploy to Azure Web apps | |
- name: 'Run Azure webapp deploy' | |
uses: azure/webapps-deploy@v2 | |
with: | |
app-name: ${{ env.AZURE_WEBAPP_NAME }} # Replace with your app name | |
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} # Define secret variable in repository settings as per action documentation | |
package: '${{ env.AZURE_WEBAPP_PACKAGE_PATH }}/${{ env.AZURE_WEBAPP_NAME }}' |