Deploy to Azure App Service #8
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 to Azure App Service | |
| on: | |
| push: | |
| branches: [main] | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - uses: actions/cache@v4 | |
| with: | |
| path: ~/.nuget/packages | |
| key: nuget-${{ runner.os }}-${{ hashFiles('src/**/*.csproj') }} | |
| restore-keys: | | |
| nuget-${{ runner.os }}- | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'npm' | |
| cache-dependency-path: src/Clientside/package-lock.json | |
| - name: Build frontend | |
| working-directory: src/Clientside | |
| run: | | |
| npm ci --legacy-peer-deps | |
| npm run build | |
| - name: Publish backend | |
| working-directory: src | |
| run: | | |
| dotnet restore | |
| dotnet publish Agoda.DevExTelemetry.WebApi/Agoda.DevExTelemetry.WebApi.csproj \ | |
| -c Release \ | |
| -o ../publish \ | |
| --no-restore | |
| - name: Deploy to Azure Web App | |
| uses: azure/webapps-deploy@v3 | |
| with: | |
| app-name: ${{ secrets.AZURE_WEBAPP_NAME }} | |
| publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} | |
| package: ./publish |