diff --git a/.github/workflows/azure-static-web-apps-orange-water-0badfae10.yml b/.github/workflows/azure-static-web-apps-orange-water-0badfae10.yml
new file mode 100644
index 0000000..806b55c
--- /dev/null
+++ b/.github/workflows/azure-static-web-apps-orange-water-0badfae10.yml
@@ -0,0 +1,59 @@
+name: Azure Static Web Apps CI/CD
+
+on:
+ push:
+ branches:
+ - main
+ pull_request:
+ types: [opened, synchronize, reopened, closed]
+ branches:
+ - main
+
+jobs:
+ build_and_deploy_job:
+ if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
+ runs-on: ubuntu-latest
+ name: Build and Deploy Job
+ steps:
+ - name: Checkout Code
+ uses: actions/checkout@v3
+ with:
+ submodules: true
+ lfs: false
+
+ - name: Setup .NET
+ uses: actions/setup-dotnet@v3
+ with:
+ dotnet-version: '8.0.x'
+
+ - name: Restore Dependencies
+ run: dotnet restore ./Client/Client.csproj
+
+ - name: Publish Blazor App with Brotli & Trimming
+ run: |
+ dotnet publish ./Client/Client.csproj \
+ -c Release \
+ -o build \
+ -p:BlazorWebAssemblyEnableCompression=true \
+ -p:PublishTrimmed=true
+
+ - name: Deploy to Azure Static Web App
+ uses: Azure/static-web-apps-deploy@v1
+ with:
+ azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_ORANGE_WATER_0BADFAE10 }}
+ repo_token: ${{ secrets.GITHUB_TOKEN }}
+ action: "upload"
+ app_location: "." # Root path — not used when using `output_location`
+ api_location: "Api" # Optional: Azure Function App folder (if any)
+ output_location: "build/wwwroot" # Pointing to the manually published output
+
+ close_pull_request_job:
+ if: github.event_name == 'pull_request' && github.event.action == 'closed'
+ runs-on: ubuntu-latest
+ name: Close Pull Request Job
+ steps:
+ - name: Close Pull Request Preview
+ uses: Azure/static-web-apps-deploy@v1
+ with:
+ azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_ORANGE_WATER_0BADFAE10 }}
+ action: "close"
diff --git a/Api/WeatherForecastFunction.cs b/Api/Functions/WeatherForecastFunction.cs
similarity index 98%
rename from Api/WeatherForecastFunction.cs
rename to Api/Functions/WeatherForecastFunction.cs
index 706badb..2875c93 100644
--- a/Api/WeatherForecastFunction.cs
+++ b/Api/Functions/WeatherForecastFunction.cs
@@ -4,7 +4,7 @@
using Microsoft.Azure.Functions.Worker.Http;
using Microsoft.Extensions.Logging;
-namespace Api
+namespace Api.Functions
{
public class HttpTrigger
{
diff --git a/Client/Client.csproj b/Client/Client.csproj
index 2578370..5023c68 100644
--- a/Client/Client.csproj
+++ b/Client/Client.csproj
@@ -4,7 +4,16 @@