Deploy on Azure #1
This file contains hidden or 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 on Azure | |
| on: | |
| push: | |
| branches: [ master ] | |
| paths: [ 'src/**' ] | |
| workflow_dispatch: | |
| env: | |
| AZURE_WEBAPP_NAME: test0000000000001 | |
| AZURE_WEBAPP_PACKAGE_PATH: './published' | |
| NET_VERSION: '9.x' | |
| PROJECT_NAME: src/PdfSmith | |
| RUNTIME: linux-x64 | |
| jobs: | |
| build-and-deploy: | |
| name: Build and Deploy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Setup .NET SDK ${{ env.NET_VERSION }} | |
| uses: actions/setup-dotnet@v3 | |
| with: | |
| dotnet-version: ${{ env.NET_VERSION }} | |
| dotnet-quality: 'ga' | |
| - name: Publish | |
| run: dotnet publish ${{ env.PROJECT_NAME }} --configuration Release --runtime ${{ env.RUNTIME }} --self-contained true --output ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} | |
| - name: Deploy to Azure Web App | |
| 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 }} |