From b0ef3ac089c4af25143be3237c0d54577a80d183 Mon Sep 17 00:00:00 2001 From: WaelZEIN6 Date: Wed, 14 Jan 2026 14:22:03 +0100 Subject: [PATCH 01/14] Add GitHub Actions workflow for Azure deployment --- .github/workflows/deploy-infra-and-apps.yml | 35 +++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/deploy-infra-and-apps.yml diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml new file mode 100644 index 00000000..1cc0144f --- /dev/null +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -0,0 +1,35 @@ +on: [push, workflow_dispatch] + +env: + AZURE_RG_NAME: rg-${{ vars.PROJECT_NAME }}-${{ vars.AZURE_RESOURCE_IDENTIFIER }} + +jobs: + deploy_infrastructure: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Login to Azure + uses: azure/login@v2 + with: + client-id: ${{ secrets.AZURE_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + enable-AzPSSession: true + + - name: Create resource group if not exists + run: | + az group show --name ${{ env.AZURE_RG_NAME }} || + az group create --name ${{ env.AZURE_RG_NAME }} --location ${{ secrets.AZURE_REGION }} + + - name: Deploy bicep + id: bicep_deploy + uses: azure/arm-deploy@v2 + with: + subscriptionId: ${{ secrets.AZURE_SUBSCRIPTION }} + region: ${{ secrets.AZURE_REGION }} + template: ./infrastructure/main.bicep + parameters: project=${{ vars.PROJECT_NAME }} location=${{ secrets.AZURE_REGION }} identifier=${{ vars.AZURE_RESOURCE_IDENTIFIER }} + resourceGroupName: ${{ env.AZURE_RG_NAME }} From 78194cc87a458f04bdf0389471f7e49194a353a1 Mon Sep 17 00:00:00 2001 From: waelzein Date: Wed, 14 Jan 2026 14:24:35 +0100 Subject: [PATCH 02/14] first commit --- infrastructure/modules/appService.bicep | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 infrastructure/modules/appService.bicep diff --git a/infrastructure/modules/appService.bicep b/infrastructure/modules/appService.bicep new file mode 100644 index 00000000..740e0841 --- /dev/null +++ b/infrastructure/modules/appService.bicep @@ -0,0 +1,22 @@ +param location string +param project string +param identifier string + +// App Service Plan identifier that will host our App Service +param planId string + +resource app 'Microsoft.Web/sites@2022-03-01' = { + name: '${project}-app-${identifier}' + location: location + + properties: { + serverFarmId: planId + reserved: true + + siteConfig: { + linuxFxVersion: 'DOTNETCORE|9.0' // Specify to setup the .NET Core 9.0 runtime (used by our backend API) on the Linux machine under the hood + } + } +} + +output appServiceName string = app.name // Export the App Service name for deployment \ No newline at end of file From 89f90f7b500c372b0562dcee228db057c1b4ff95 Mon Sep 17 00:00:00 2001 From: waelzein Date: Wed, 14 Jan 2026 14:24:58 +0100 Subject: [PATCH 03/14] second commit --- infrastructure/main.bicep | 32 +++++++++++++++++++++ infrastructure/modules/appServicePlan.bicep | 20 +++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 infrastructure/main.bicep create mode 100644 infrastructure/modules/appServicePlan.bicep diff --git a/infrastructure/main.bicep b/infrastructure/main.bicep new file mode 100644 index 00000000..22252465 --- /dev/null +++ b/infrastructure/main.bicep @@ -0,0 +1,32 @@ +targetScope = 'resourceGroup' // We'll deploy the resources in the provided resource group + +// Parameters to easily construct resource names +param location string +param project string + +// Here we'll add an identifier to create a unique name for the App Service Plan, for example your trigram, so that everyone could deploy his own parkndeploy instance +param identifier string + +// Create the AppServicePlan through the AppServicePlan module +module appServicePlan 'modules/appServicePlan.bicep' = { + name: 'appServicePlan' + params: { + location: location + project: project + identifier: identifier + } +} + +// Create the AppService through the AppService module +module appService 'modules/appService.bicep' = { + name: 'appService' + params: { + location: location + project: project + identifier: identifier + planId: appServicePlan.outputs.planId // Use the appServicePlan output to get its id back => an App Service needs to reference its App Service Plan + } +} + +// Export App Service Name +output appServiceName string = appService.outputs.appServiceName \ No newline at end of file diff --git a/infrastructure/modules/appServicePlan.bicep b/infrastructure/modules/appServicePlan.bicep new file mode 100644 index 00000000..c871995f --- /dev/null +++ b/infrastructure/modules/appServicePlan.bicep @@ -0,0 +1,20 @@ +param location string +param project string +param identifier string + +resource plan 'Microsoft.Web/serverfarms@2022-09-01' = { + name: '${project}-plan-${identifier}' + location: location + + sku: { + name: 'F1' // We use F1 pricing plan (free one) as we don't need specific features + } + + kind: 'app,linux' // Allow to deploy on an App Service using Linux OS + + properties: { + reserved: true // Specifity of App Service with Linux OS + } +} + +output planId string = plan.id // Export the App Service identifier \ No newline at end of file From fe2dcd5a661438a801e345fe99c3703ee8dd1728 Mon Sep 17 00:00:00 2001 From: WaelZEIN6 Date: Wed, 14 Jan 2026 14:50:07 +0100 Subject: [PATCH 04/14] Update GitHub Actions workflow with OIDC permissions Added permissions for OIDC token fetching in GitHub Actions. --- .github/workflows/deploy-infra-and-apps.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index 1cc0144f..f92283ed 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -1,11 +1,17 @@ on: [push, workflow_dispatch] +permissions: + # Require write permission to Fetch an OIDC token (required for federated credential) and write it + # It will be automatically used on actions / cli that needs it + id-token: write + env: AZURE_RG_NAME: rg-${{ vars.PROJECT_NAME }}-${{ vars.AZURE_RESOURCE_IDENTIFIER }} - + jobs: deploy_infrastructure: runs-on: ubuntu-latest + environment: production # bind the job to the production environment steps: - name: Checkout repository From 5ae401a90b0a963ff15d9a48774ef02c5b848a36 Mon Sep 17 00:00:00 2001 From: waelzein Date: Wed, 14 Jan 2026 15:49:23 +0100 Subject: [PATCH 05/14] add workflow data for backend --- .github/workflows/deploy-infra-and-apps.yml | 35 ++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index f92283ed..89d45312 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -13,6 +13,9 @@ jobs: runs-on: ubuntu-latest environment: production # bind the job to the production environment + outputs: + appServiceName: ${{ steps.bicep_deploy.outputs.appServiceName }} + steps: - name: Checkout repository uses: actions/checkout@v4 @@ -20,7 +23,7 @@ jobs: - name: Login to Azure uses: azure/login@v2 with: - client-id: ${{ secrets.AZURE_CLIENT_ID }} + client-id: ${{ .AZURE_CLIENT_ID }} tenant-id: ${{ secrets.AZURE_TENANT_ID }} subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} enable-AzPSSession: true @@ -39,3 +42,33 @@ jobs: template: ./infrastructure/main.bicep parameters: project=${{ vars.PROJECT_NAME }} location=${{ secrets.AZURE_REGION }} identifier=${{ vars.AZURE_RESOURCE_IDENTIFIER }} resourceGroupName: ${{ env.AZURE_RG_NAME }} + deploy_backend: + runs-on: ubuntu-latest + needs: deploy_infrastructure + environment: production + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup .NET SDK 9.0.x + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '9.0.x' + + - name: Publish the app + run: dotnet publish -c Release --property:PublishDir=publish # Publish the app to the API project publish folder + working-directory: ./backend # Specify where to find the solution file in repository + + - name: Login to Azure + uses: azure/login@v2 + with: + client-id: ${{ secrets.AZURE_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + + - name: Deploy backend to App Service + uses: azure/webapps-deploy@v2 + with: + app-name: ${{ needs.deploy_infrastructure.outputs.appServiceName }} # Access to the previous job output to get the appServiceName deployed with bicep + package: ./backend/ParkNDeploy.Api/publish # Path to the previously published app \ No newline at end of file From 6864112d28018fb8c4aeb288a1307bc2ff19a1cf Mon Sep 17 00:00:00 2001 From: waelzein Date: Wed, 14 Jan 2026 15:53:05 +0100 Subject: [PATCH 06/14] s --- .github/workflows/deploy-infra-and-apps.yml | 55 +++++++++++---------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index 89d45312..9afb4d2f 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -42,33 +42,34 @@ jobs: template: ./infrastructure/main.bicep parameters: project=${{ vars.PROJECT_NAME }} location=${{ secrets.AZURE_REGION }} identifier=${{ vars.AZURE_RESOURCE_IDENTIFIER }} resourceGroupName: ${{ env.AZURE_RG_NAME }} - deploy_backend: - runs-on: ubuntu-latest - needs: deploy_infrastructure - environment: production - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Setup .NET SDK 9.0.x - uses: actions/setup-dotnet@v4 - with: - dotnet-version: '9.0.x' - - - name: Publish the app - run: dotnet publish -c Release --property:PublishDir=publish # Publish the app to the API project publish folder - working-directory: ./backend # Specify where to find the solution file in repository + deploy_backend: + runs-on: ubuntu-latest + needs: deploy_infrastructure + environment: production - - name: Login to Azure - uses: azure/login@v2 - with: - client-id: ${{ secrets.AZURE_CLIENT_ID }} - tenant-id: ${{ secrets.AZURE_TENANT_ID }} - subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup .NET SDK 9.0.x + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '9.0.x' - - name: Deploy backend to App Service - uses: azure/webapps-deploy@v2 - with: - app-name: ${{ needs.deploy_infrastructure.outputs.appServiceName }} # Access to the previous job output to get the appServiceName deployed with bicep - package: ./backend/ParkNDeploy.Api/publish # Path to the previously published app \ No newline at end of file + - name: Publish the app + run: dotnet publish -c Release --property:PublishDir=publish # Publish the app to the API project publish folder + working-directory: ./backend # Specify where to find the solution file in repository + + - name: Login to Azure + uses: azure/login@v2 + with: + client-id: ${{ secrets.AZURE_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + + - name: Deploy backend to App Service + uses: azure/webapps-deploy@v2 + with: + app-name: ${{ needs.deploy_infrastructure.outputs.appServiceName }} # Access to the previous job output to get the appServiceName deployed with bicep + package: ./backend/ParkNDeploy.Api/publish # Path to the previously published app \ No newline at end of file From 78fa96d2fe1d29541405416a69610432231bc43d Mon Sep 17 00:00:00 2001 From: waelzein Date: Wed, 14 Jan 2026 15:54:02 +0100 Subject: [PATCH 07/14] test --- .github/workflows/deploy-infra-and-apps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index 9afb4d2f..8e1762bd 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -23,7 +23,7 @@ jobs: - name: Login to Azure uses: azure/login@v2 with: - client-id: ${{ .AZURE_CLIENT_ID }} + client-id: ${{ secrets.AZURE_CLIENT_ID }} tenant-id: ${{ secrets.AZURE_TENANT_ID }} subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} enable-AzPSSession: true From 6f5e66b244b854d9dcea2294cb65820dd227156d Mon Sep 17 00:00:00 2001 From: waelzein Date: Wed, 14 Jan 2026 16:08:39 +0100 Subject: [PATCH 08/14] Deploy Infrastructure --- .github/workflows/deploy-infra-and-apps.yml | 2 +- infrastructure/main.bicep | 16 +++++++++++++++- infrastructure/modules/staticWebApp.bicep | 16 ++++++++++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 infrastructure/modules/staticWebApp.bicep diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index 8e1762bd..c2742700 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -40,7 +40,7 @@ jobs: subscriptionId: ${{ secrets.AZURE_SUBSCRIPTION }} region: ${{ secrets.AZURE_REGION }} template: ./infrastructure/main.bicep - parameters: project=${{ vars.PROJECT_NAME }} location=${{ secrets.AZURE_REGION }} identifier=${{ vars.AZURE_RESOURCE_IDENTIFIER }} + parameters: project=${{ vars.PROJECT_NAME }} location=${{ secrets.AZURE_REGION }} swaLocation=${{ secrets.AZURE_SWA_REGION }} identifier=${{ vars.AZURE_RESOURCE_IDENTIFIER }} resourceGroupName: ${{ env.AZURE_RG_NAME }} deploy_backend: diff --git a/infrastructure/main.bicep b/infrastructure/main.bicep index 22252465..2043129a 100644 --- a/infrastructure/main.bicep +++ b/infrastructure/main.bicep @@ -1,3 +1,4 @@ +param swaLocation string // Static Web App locations are limited, we need to add another variable targetScope = 'resourceGroup' // We'll deploy the resources in the provided resource group // Parameters to easily construct resource names @@ -28,5 +29,18 @@ module appService 'modules/appService.bicep' = { } } +// Create the Static Web App through the StaticWebApp module +module staticWebApp 'modules/staticWebApp.bicep' = { + name: 'staticWebApp' + params: { + location: swaLocation + project: project + identifier: identifier + } +} + + // Export App Service Name -output appServiceName string = appService.outputs.appServiceName \ No newline at end of file +output appServiceName string = appService.outputs.appServiceName +output appServiceName string = appService.outputs.appServiceName // Export AppServiceName in order to deploy the API later on +output staticWebAppName string = staticWebApp.outputs.swaName // Export StaticWebAppName in order to deploy the Frontend late diff --git a/infrastructure/modules/staticWebApp.bicep b/infrastructure/modules/staticWebApp.bicep new file mode 100644 index 00000000..58806c9e --- /dev/null +++ b/infrastructure/modules/staticWebApp.bicep @@ -0,0 +1,16 @@ +param location string +param project string +param identifier string + +resource swa 'Microsoft.Web/staticSites@2024-04-01 ' = { + name: '${project}-swa-${identifier}' + location: location + + sku: { + name: 'Free' + } + + properties: {} // Even empty, it's mandatory ... +} + +output swaName string = swa.name // Expose Static Web App name as we did for App Service for deployment purpose From 55fcdf980b594b4e6670129133d79e734b1d23d4 Mon Sep 17 00:00:00 2001 From: waelzein Date: Wed, 14 Jan 2026 16:12:03 +0100 Subject: [PATCH 09/14] test --- infrastructure/main.bicep | 1 - infrastructure/modules/staticWebApp.bicep | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/infrastructure/main.bicep b/infrastructure/main.bicep index 2043129a..deff0832 100644 --- a/infrastructure/main.bicep +++ b/infrastructure/main.bicep @@ -41,6 +41,5 @@ module staticWebApp 'modules/staticWebApp.bicep' = { // Export App Service Name -output appServiceName string = appService.outputs.appServiceName output appServiceName string = appService.outputs.appServiceName // Export AppServiceName in order to deploy the API later on output staticWebAppName string = staticWebApp.outputs.swaName // Export StaticWebAppName in order to deploy the Frontend late diff --git a/infrastructure/modules/staticWebApp.bicep b/infrastructure/modules/staticWebApp.bicep index 58806c9e..cd780056 100644 --- a/infrastructure/modules/staticWebApp.bicep +++ b/infrastructure/modules/staticWebApp.bicep @@ -2,7 +2,7 @@ param location string param project string param identifier string -resource swa 'Microsoft.Web/staticSites@2024-04-01 ' = { +resource swa 'Microsoft.Web/staticSites@2024-04-01' = { name: '${project}-swa-${identifier}' location: location From 05539050f22013e9e32ceac895e8216864d2da8f Mon Sep 17 00:00:00 2001 From: waelzein Date: Wed, 14 Jan 2026 16:21:15 +0100 Subject: [PATCH 10/14] Deploy Frontend App --- .github/workflows/deploy-infra-and-apps.yml | 32 ++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index c2742700..f91255e5 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -15,6 +15,7 @@ jobs: outputs: appServiceName: ${{ steps.bicep_deploy.outputs.appServiceName }} + staticWebAppName: ${{ steps.bicep_deploy.outputs.staticWebAppName }} steps: - name: Checkout repository @@ -72,4 +73,33 @@ jobs: uses: azure/webapps-deploy@v2 with: app-name: ${{ needs.deploy_infrastructure.outputs.appServiceName }} # Access to the previous job output to get the appServiceName deployed with bicep - package: ./backend/ParkNDeploy.Api/publish # Path to the previously published app \ No newline at end of file + package: ./backend/ParkNDeploy.Api/publish # Path to the previously published app + # deploy_infrastructure ... + +deploy_frontend: + runs-on: ubuntu-latest + needs: deploy_infrastructure + environment: production + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Build the app + run: npm install && npm run build + working-directory: ./frontend + + - name: Login to Azure + uses: azure/login@v2 + with: + client-id: ${{ secrets.AZURE_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + + - name: Deploy frontend to Static Web App + uses: azure/static-web-apps-deploy@v1 + with: + app_location: frontend/dist + action: upload + skip_app_build: true + skip_api_build: true \ No newline at end of file From 0ec780e281b98b7fa472c5548abb869f6127ad49 Mon Sep 17 00:00:00 2001 From: waelzein Date: Wed, 14 Jan 2026 16:22:36 +0100 Subject: [PATCH 11/14] Deploy Frontend App --- .github/workflows/deploy-infra-and-apps.yml | 54 ++++++++++----------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index f91255e5..11c74b3b 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -76,30 +76,30 @@ jobs: package: ./backend/ParkNDeploy.Api/publish # Path to the previously published app # deploy_infrastructure ... -deploy_frontend: - runs-on: ubuntu-latest - needs: deploy_infrastructure - environment: production - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Build the app - run: npm install && npm run build - working-directory: ./frontend - - - name: Login to Azure - uses: azure/login@v2 - with: - client-id: ${{ secrets.AZURE_CLIENT_ID }} - tenant-id: ${{ secrets.AZURE_TENANT_ID }} - subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - - - name: Deploy frontend to Static Web App - uses: azure/static-web-apps-deploy@v1 - with: - app_location: frontend/dist - action: upload - skip_app_build: true - skip_api_build: true \ No newline at end of file + deploy_frontend: + runs-on: ubuntu-latest + needs: deploy_infrastructure + environment: production + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Build the app + run: npm install && npm run build + working-directory: ./frontend + + - name: Login to Azure + uses: azure/login@v2 + with: + client-id: ${{ secrets.AZURE_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + + - name: Deploy frontend to Static Web App + uses: azure/static-web-apps-deploy@v1 + with: + app_location: frontend/dist + action: upload + skip_app_build: true + skip_api_build: true \ No newline at end of file From f3788d9c5a67295b76b54fc34782b84120aeb8fb Mon Sep 17 00:00:00 2001 From: waelzein Date: Wed, 14 Jan 2026 16:41:48 +0100 Subject: [PATCH 12/14] last deploy frontend --- .github/workflows/deploy-infra-and-apps.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index 11c74b3b..64388e13 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -96,9 +96,15 @@ jobs: tenant-id: ${{ secrets.AZURE_TENANT_ID }} subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + - name: Get Static Web App deployment token + run: | + SWA_DEPLOYMENT_TOKEN=$(az staticwebapp secrets list -n ${{ needs.deploy_infrastructure.outputs.staticWebAppName }} -o tsv --query properties.apiKey) + echo SWA_DEPLOYMENT_TOKEN=$SWA_DEPLOYMENT_TOKEN >> $GITHUB_ENV + - name: Deploy frontend to Static Web App uses: azure/static-web-apps-deploy@v1 with: + azure_static_web_apps_api_token: ${{ env.SWA_DEPLOYMENT_TOKEN }} app_location: frontend/dist action: upload skip_app_build: true From 8f89ab3a6a97d938d701ee5fae786fe38d37379f Mon Sep 17 00:00:00 2001 From: waelzein Date: Wed, 14 Jan 2026 16:50:47 +0100 Subject: [PATCH 13/14] correction connexion troubles --- infrastructure/main.bicep | 10 ++++++++++ infrastructure/modules/appService.bicep | 3 ++- infrastructure/modules/staticWebApp.bicep | 7 ++++--- infrastructure/modules/staticWebAppBackend.bicep | 11 +++++++++++ 4 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 infrastructure/modules/staticWebAppBackend.bicep diff --git a/infrastructure/main.bicep b/infrastructure/main.bicep index deff0832..6a3707a5 100644 --- a/infrastructure/main.bicep +++ b/infrastructure/main.bicep @@ -39,6 +39,16 @@ module staticWebApp 'modules/staticWebApp.bicep' = { } } +module staticWebAppBackend 'modules/staticWebAppBackend.bicep' = { + name: 'staticWebAppBackend' + params: { + backendBindedResourceId: appService.outputs.appServiceId + swaName: staticWebApp.outputs.swaName + location: location + } +} + + // Export App Service Name output appServiceName string = appService.outputs.appServiceName // Export AppServiceName in order to deploy the API later on diff --git a/infrastructure/modules/appService.bicep b/infrastructure/modules/appService.bicep index 740e0841..6c728058 100644 --- a/infrastructure/modules/appService.bicep +++ b/infrastructure/modules/appService.bicep @@ -19,4 +19,5 @@ resource app 'Microsoft.Web/sites@2022-03-01' = { } } -output appServiceName string = app.name // Export the App Service name for deployment \ No newline at end of file +output appServiceName string = app.name // Export the App Service name for deployment +output appServiceId string = app.id // Export the App Service identifier for linking with Static Web App backend diff --git a/infrastructure/modules/staticWebApp.bicep b/infrastructure/modules/staticWebApp.bicep index cd780056..0925f696 100644 --- a/infrastructure/modules/staticWebApp.bicep +++ b/infrastructure/modules/staticWebApp.bicep @@ -6,9 +6,10 @@ resource swa 'Microsoft.Web/staticSites@2024-04-01' = { name: '${project}-swa-${identifier}' location: location - sku: { - name: 'Free' - } + sku: { + name: 'Standard' + tier: 'Standard' +} properties: {} // Even empty, it's mandatory ... } diff --git a/infrastructure/modules/staticWebAppBackend.bicep b/infrastructure/modules/staticWebAppBackend.bicep new file mode 100644 index 00000000..4e902770 --- /dev/null +++ b/infrastructure/modules/staticWebAppBackend.bicep @@ -0,0 +1,11 @@ +param backendBindedResourceId string +param swaName string +param location string + +resource staticWebAppBackend 'Microsoft.Web/staticSites/linkedBackends@2022-03-01' = { + name: '${swaName}/backend' + properties: { + backendResourceId: backendBindedResourceId + region: location + } +} From 4d724b759a8e7807d9fe97124c97f780c0b6bcc3 Mon Sep 17 00:00:00 2001 From: waelzein Date: Tue, 20 Jan 2026 10:29:43 +0100 Subject: [PATCH 14/14] =?UTF-8?q?Ajout=20du=20pipeline=20de=20v=C3=A9rific?= =?UTF-8?q?ation=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci-check.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/ci-check.yml diff --git a/.github/workflows/ci-check.yml b/.github/workflows/ci-check.yml new file mode 100644 index 00000000..b9642d26 --- /dev/null +++ b/.github/workflows/ci-check.yml @@ -0,0 +1,32 @@ +name: CI Check - Merge Request + +# On ne le lance QUE sur les Merge Requests +on: + pull_request: + branches: [ main, master ] + +jobs: + # Étape Frontend : on reprend tes commandes 'npm' + check_frontend: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Build & Lint Frontend + run: | + npm install + npm run lint + npm run build + working-directory: ./frontend + + # Étape Backend : on reprend ton 'dotnet publish' (qui inclut le build) + check_backend: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '9.0.x' + - name: Build Backend Release + run: dotnet build -c Release + working-directory: ./backend \ No newline at end of file