From 8b29068e627954ded41ac35e34c120900bc1986e Mon Sep 17 00:00:00 2001 From: Anurag Chauhan <44864882+anuragc617@users.noreply.github.com> Date: Fri, 9 Oct 2020 13:37:38 +0530 Subject: [PATCH] Added GitHub Workflow YAML definition. --- .github/workflows/workflow.yml | 46 ++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/workflow.yml diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml new file mode 100644 index 0000000..e2901d5 --- /dev/null +++ b/.github/workflows/workflow.yml @@ -0,0 +1,46 @@ +on: + push: + branches: + - master +name: Build and deploy .NET Core app to Linux WebApp + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@master + + - uses: azure/login@v1 + with: + creds: ${{ secrets.AZURE_CREDENTIALS_GITHUB_SECRET_b573 }} + + - name: Setup .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 1.1.x + + - name: Install dependencies + run: dotnet restore aspnet-core-dotnet-core + + - name: Build + run: dotnet build aspnet-core-dotnet-core --configuration Release --no-restore + + - name: Publish artifact + run: dotnet publish aspnet-core-dotnet-core --configuration Release --no-build --output publish + + - uses: azure/appservice-settings@v1 + with: + app-name: anchauhLinuxWebApp + general-settings-json: '{"linuxFxVersion": "DOTNETCORE|1.1"}' #'General configuration settings as Key Value pairs' + + - name: Deploy to Azure WebApp + uses: azure/webapps-deploy@v1 + with: + app-name: anchauhLinuxWebApp + package: aspnet-core-dotnet-core/publish + + - name: logout + run: | + az logout