diff --git a/.github/workflows/dotnetcore-deploy.yml b/.github/workflows/dotnetcore-deploy.yml index ba1e8eb..dd51907 100644 --- a/.github/workflows/dotnetcore-deploy.yml +++ b/.github/workflows/dotnetcore-deploy.yml @@ -1,31 +1,31 @@ name: .NET Core - Release from Master -# # Run when pushed to master (successfull PR with branch permissions turned on) -# on: push: - branches: master - + branches: master env: AZURE_WEBAPP_NAME: qrcode-api-app # set this to your application's name - jobs: build-and-deploy: - runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - - name: Login to Azure - run: dotnet build --configuration Release + - name: Setup .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 2.2.108 + - name: Build with dotnet + run: dotnet build --configuration Release + - name: dotnet publish - run: | - echo "Logging into Azure..." - az login --service-principal -u ${{ secrets.CLIENT_ID }} -p ${{ secrets.CLIENT_SECRET }} --tenant ${{ secrets.TENANT_ID }} - - - name: 'Perform an az cli appservice slotswap' - run: | - echo "Running a CLI Slot Swap..." - az webapp deployment slot swap --name qrcode-api-app --resource-group rgDoNotDeleteDemos --slot test --target-slot Production + run: dotnet publish -c Release -o ${{env.DOTNET_ROOT}}/myapp + + - name: 'Run Azure webapp deploy action using publish profile credentials' + uses: azure/webapps-deploy@v1 + with: + app-name: ${{env.AZURE_WEBAPP_NAME}} + publish-profile: ${{ secrets.azureWebAppPublishProfile }} + package: ${{env.DOTNET_ROOT}}/myapp