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'