fix: Increment all asset versions (v3.0/v4.0) for cache busting #10
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: | |
| - master | |
| paths: | |
| - 'SimpleApi/**' | |
| - '.github/workflows/azure-deploy.yml' | |
| workflow_dispatch: | |
| env: | |
| AZURE_WEBAPP_NAME: prepreater | |
| DOTNET_VERSION: '9.0.x' | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: ${{ env.DOTNET_VERSION }} | |
| - name: Restore dependencies | |
| run: dotnet restore SimpleApi/SimpleApi.csproj | |
| - name: Build | |
| run: dotnet build SimpleApi/SimpleApi.csproj --configuration Release --no-restore | |
| - name: Publish | |
| run: dotnet publish SimpleApi/SimpleApi.csproj --configuration Release --no-build --output ./publish | |
| - name: Login to Azure | |
| uses: azure/login@v1 | |
| with: | |
| creds: ${{ secrets.AZURE_CREDENTIALS }} | |
| - name: Deploy to Azure Web App | |
| uses: azure/webapps-deploy@v2 | |
| with: | |
| app-name: ${{ env.AZURE_WEBAPP_NAME }} | |
| package: ./publish | |
| - name: Azure logout | |
| run: az logout | |
| if: always() | |
| # Optional: Notify on deployment status | |
| notify: | |
| needs: build-and-deploy | |
| runs-on: ubuntu-latest | |
| if: always() | |
| steps: | |
| - name: Deployment Status | |
| run: | | |
| if [ "${{ needs.build-and-deploy.result }}" == "success" ]; then | |
| echo "✅ Deployment successful!" | |
| else | |
| echo "❌ Deployment failed!" | |
| exit 1 | |
| fi |