From e1f88fee353f4554e192e35e17e4e8c5e33debdd Mon Sep 17 00:00:00 2001 From: Carlos Pavajeau Date: Mon, 30 Aug 2021 11:52:43 -0500 Subject: [PATCH] ci: add workflows for deploy to azure --- .github/workflows/deploy-azure.yml | 35 ++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/deploy-azure.yml diff --git a/.github/workflows/deploy-azure.yml b/.github/workflows/deploy-azure.yml new file mode 100644 index 00000000..4211572e --- /dev/null +++ b/.github/workflows/deploy-azure.yml @@ -0,0 +1,35 @@ +name: Deploy to Azure + +on: [ release ] + +env: + AZURE_WEBAPP_NAME: armoryapi + AZURE_WEBAPP_PACKAGE_PATH: '.' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + # Checkout the repo + - uses: actions/checkout@main + + - name: Setup .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 5.0.x + + # Run dotnet build and publish + - name: dotnet build and publish + run: | + dotnet restore + dotnet build --configuration Release + dotnet publish -c Release -o '${{ env.AZURE_WEBAPP_PACKAGE_PATH }}/armory_out' + + # Deploy to Azure Web apps + - name: 'Run Azure webapp deploy action using publish profile credentials' + uses: azure/webapps-deploy@v2 + with: + app-name: ${{ env.AZURE_WEBAPP_NAME }} + publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} + package: '${{ env.AZURE_WEBAPP_PACKAGE_PATH }}/armory_out'