From b061e9288a315b8e60ce867f4e53db41edacc8d7 Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 14 Jan 2026 15:30:38 +0100 Subject: [PATCH 01/41] creation des fichiers d'infrastructure et deploiement apps workflows --- .github/workflows/deploy-infra-and-apps.yml | 49 +++++++++++++++++++++ infrastructure/main.bicep | 32 ++++++++++++++ infrastructure/modules/appService.bicep | 22 +++++++++ infrastructure/modules/appServicePlan.bicep | 20 +++++++++ 4 files changed, 123 insertions(+) create mode 100644 .github/workflows/deploy-infra-and-apps.yml create mode 100644 infrastructure/main.bicep create mode 100644 infrastructure/modules/appService.bicep create mode 100644 infrastructure/modules/appServicePlan.bicep diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml new file mode 100644 index 00000000..ebc09730 --- /dev/null +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -0,0 +1,49 @@ +on: [push, workflow_dispatch] +# on +# ... + +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 +# ... + +deploy_infrastructure: + runs-on: ubuntu-latest + environment: production # bind the job to the production environment + +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 }} \ No newline at end of file diff --git a/infrastructure/main.bicep b/infrastructure/main.bicep new file mode 100644 index 00000000..22bac17a --- /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 diff --git a/infrastructure/modules/appService.bicep b/infrastructure/modules/appService.bicep new file mode 100644 index 00000000..40b49099 --- /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 diff --git a/infrastructure/modules/appServicePlan.bicep b/infrastructure/modules/appServicePlan.bicep new file mode 100644 index 00000000..c9b43403 --- /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 From b3b4e7abe69059c058d56877ff2d78f9168b3b35 Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 14 Jan 2026 15:43:25 +0100 Subject: [PATCH 02/41] modif deploy_infrastructure job to bind it to production environment --- .github/workflows/deploy-infra-and-apps.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index ebc09730..aeb09bfc 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -7,12 +7,8 @@ permissions: # It will be automatically used on actions / cli that needs it id-token: write -# env -# ... -deploy_infrastructure: - runs-on: ubuntu-latest - environment: production # bind the job to the production environment + env: AZURE_RG_NAME: rg-${{ vars.PROJECT_NAME }}-${{ vars.AZURE_RESOURCE_IDENTIFIER }} @@ -20,7 +16,7 @@ env: jobs: deploy_infrastructure: runs-on: ubuntu-latest - + environment: production # bind the job to the production environment steps: - name: Checkout repository uses: actions/checkout@v4 From 7280e19cba0960763e80ec61c5505eb2f4338fd8 Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 14 Jan 2026 16:03:47 +0100 Subject: [PATCH 03/41] added backend deployment to production environment --- .github/workflows/deploy-infra-and-apps.yml | 33 ++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index aeb09bfc..2b829f56 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -42,4 +42,35 @@ jobs: 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 }} \ No newline at end of file + 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 0b198be6cae3843591dc4b4621b594215e695355 Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 14 Jan 2026 16:05:04 +0100 Subject: [PATCH 04/41] fixed indentation --- .github/workflows/deploy-infra-and-apps.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index 2b829f56..caed1838 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -43,8 +43,7 @@ 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: + deploy_backend: runs-on: ubuntu-latest needs: deploy_infrastructure environment: production From 1010c07eaa28dd0db8c61c693082d518de167bfc Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 14 Jan 2026 16:11:43 +0100 Subject: [PATCH 05/41] fixed missing line --- .github/workflows/deploy-infra-and-apps.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index caed1838..d5b253de 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -17,6 +17,8 @@ jobs: deploy_infrastructure: 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 From f9f7235070f63b2d2e9648fc067eafee17013988 Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 14 Jan 2026 16:22:11 +0100 Subject: [PATCH 06/41] added static web app module and integrated it into main bicep and workflow --- .github/workflows/deploy-infra-and-apps.yml | 2 +- infrastructure/main.bicep | 15 +++++++++++++-- infrastructure/modules/staticWebApp.bicep | 16 ++++++++++++++++ 3 files changed, 30 insertions(+), 3 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 d5b253de..75f9902f 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -43,7 +43,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: runs-on: ubuntu-latest diff --git a/infrastructure/main.bicep b/infrastructure/main.bicep index 22bac17a..5eb6b5c4 100644 --- a/infrastructure/main.bicep +++ b/infrastructure/main.bicep @@ -3,7 +3,7 @@ targetScope = 'resourceGroup' // We'll deploy the resources in the provided reso // Parameters to easily construct resource names param location string param project string - +param swaLocation string // Static Web App locations are limited, we need to add another variable // 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 @@ -28,5 +28,16 @@ module appService 'modules/appService.bicep' = { } } +module staticWebApp 'modules/staticWebApp.bicep' = { + name: 'staticWebApp' + params: { + location: swaLocation + project: project + identifier: identifier + } +} + // 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 new file mode 100644 index 00000000..cd780056 --- /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 589d9cfe75598b96817531f1ff9cd4d522a87480 Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 14 Jan 2026 17:02:27 +0100 Subject: [PATCH 07/41] frontend deployment and backend deployment to use the correct Static Web App name and App Service name respectively. --- .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 75f9902f..ca03e0e2 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -19,6 +19,7 @@ jobs: environment: production # bind the job to the production environment outputs: appServiceName: ${{ steps.bicep_deploy.outputs.appServiceName }} + staticWebAppName: ${{ steps.bicep_deploy.outputs.staticWebAppName }} steps: - name: Checkout repository uses: actions/checkout@v4 @@ -74,4 +75,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 d5e647a29c9899704c9effc013d869bd5f4501f3 Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 14 Jan 2026 17:03:18 +0100 Subject: [PATCH 08/41] fixed indentation (again) --- .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 ca03e0e2..f6b95547 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -78,7 +78,7 @@ jobs: package: ./backend/ParkNDeploy.Api/publish # Path to the previously published app # deploy_infrastructure ... -deploy_frontend: + deploy_frontend: runs-on: ubuntu-latest needs: deploy_infrastructure environment: production From d92eb8f1e67cfd4c0b7ed1dc83f666b714d2f34b Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 14 Jan 2026 17:11:46 +0100 Subject: [PATCH 09/41] added static web app deployment and outputs --- .github/workflows/deploy-infra-and-apps.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index f6b95547..a46923dd 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -97,10 +97,22 @@ jobs: client-id: ${{ secrets.AZURE_CLIENT_ID }} tenant-id: ${{ secrets.AZURE_TENANT_ID }} subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - + + # Login to Azure + # ... + + - 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 + + # Deploy frontend to Static Web App + # ... + - 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 28b2fd1c8ca825788a8051223019d317859871af Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 14 Jan 2026 17:18:50 +0100 Subject: [PATCH 10/41] more front --- infrastructure/main.bicep | 9 ++++++++- infrastructure/modules/appService.bicep | 2 ++ infrastructure/modules/staticWebApp.bicep | 7 ++++--- infrastructure/modules/staticWebAppBackEnd.bicep | 11 +++++++++++ 4 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 infrastructure/modules/staticWebAppBackEnd.bicep diff --git a/infrastructure/main.bicep b/infrastructure/main.bicep index 5eb6b5c4..a032ac2a 100644 --- a/infrastructure/main.bicep +++ b/infrastructure/main.bicep @@ -36,7 +36,14 @@ module staticWebApp 'modules/staticWebApp.bicep' = { identifier: identifier } } - +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 40b49099..5caaed46 100644 --- a/infrastructure/modules/appService.bicep +++ b/infrastructure/modules/appService.bicep @@ -20,3 +20,5 @@ resource app 'Microsoft.Web/sites@2022-03-01' = { } output appServiceName string = app.name // Export the App Service name for deployment + +output appServiceId string = app.id 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 db94f8b4952c2c5a32167a7b07eaaf1395b03b37 Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 14 Jan 2026 17:23:00 +0100 Subject: [PATCH 11/41] changed some stuff --- infrastructure/modules/staticWebAppBackEnd.bicep | 1 + 1 file changed, 1 insertion(+) diff --git a/infrastructure/modules/staticWebAppBackEnd.bicep b/infrastructure/modules/staticWebAppBackEnd.bicep index 4e902770..54598800 100644 --- a/infrastructure/modules/staticWebAppBackEnd.bicep +++ b/infrastructure/modules/staticWebAppBackEnd.bicep @@ -9,3 +9,4 @@ resource staticWebAppBackend 'Microsoft.Web/staticSites/linkedBackends@2022-03-0 region: location } } + From 28ea071621044fd2528b90ab098aca404695b1f6 Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 14 Jan 2026 17:26:15 +0100 Subject: [PATCH 12/41] ouio ui --- infrastructure/main.bicep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infrastructure/main.bicep b/infrastructure/main.bicep index a032ac2a..846de000 100644 --- a/infrastructure/main.bicep +++ b/infrastructure/main.bicep @@ -36,7 +36,7 @@ module staticWebApp 'modules/staticWebApp.bicep' = { identifier: identifier } } -module staticWebAppBackend 'modules/staticWebAppBackend.bicep' = { +module staticWebAppBackend 'modules/staticWebAppBackEnd.bicep' = { name: 'staticWebAppBackend' params: { backendBindedResourceId: appService.outputs.appServiceId From 980b0de6271738f4600c00dd0b083d6a5ec356c4 Mon Sep 17 00:00:00 2001 From: Hugo Date: Tue, 20 Jan 2026 10:25:34 +0100 Subject: [PATCH 13/41] Tag rule to force deployment only on correct version tags 'v[0-9].[0-9].[0-9]' --- .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 a46923dd..00c69705 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -1,7 +1,13 @@ -on: [push, workflow_dispatch] +on: + push: + tags: + - 'v[0-9].[0-9].[0-9]' + workflow_dispatch: # on # ... + + 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 From 3d72829188aed6d99581ed006a8a92c4f59c77a7 Mon Sep 17 00:00:00 2001 From: Hugo Date: Tue, 20 Jan 2026 11:06:34 +0100 Subject: [PATCH 14/41] gros test qui va surment pas marcher pour le pull request --- .github/workflows/deploy-infra-and-app-PR.yml | 97 +++++++++++++++++++ .github/workflows/deploy-infra-and-apps.yml | 2 +- 2 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/deploy-infra-and-app-PR.yml diff --git a/.github/workflows/deploy-infra-and-app-PR.yml b/.github/workflows/deploy-infra-and-app-PR.yml new file mode 100644 index 00000000..9304bc2c --- /dev/null +++ b/.github/workflows/deploy-infra-and-app-PR.yml @@ -0,0 +1,97 @@ + +on: + pull_request: + 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_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 + # 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 }} + + # Login to Azure + # ... + + - 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 + + # Deploy frontend to Static Web App + # ... + + - 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 + skip_api_build: true + deploy_lint: + runs-on: ubuntu-latest + needs: deploy_infrastructure + environment: production + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Build Lint + run: node run eslint.config.js + working-directory: ./frontend \ No newline at end of file diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index 00c69705..8e3fab60 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -122,4 +122,4 @@ jobs: app_location: frontend/dist action: upload skip_app_build: true - skip_api_build: true \ No newline at end of file + skip_api_build: true From 55bba147e65b44ecb12c35068426f9abdb08297b Mon Sep 17 00:00:00 2001 From: Hugo Date: Tue, 20 Jan 2026 11:09:20 +0100 Subject: [PATCH 15/41] ajout de deploy infra --- .github/workflows/deploy-infra-and-app-PR.yml | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/.github/workflows/deploy-infra-and-app-PR.yml b/.github/workflows/deploy-infra-and-app-PR.yml index 9304bc2c..0d1d2ef2 100644 --- a/.github/workflows/deploy-infra-and-app-PR.yml +++ b/.github/workflows/deploy-infra-and-app-PR.yml @@ -12,6 +12,38 @@ 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 + outputs: + appServiceName: ${{ steps.bicep_deploy.outputs.appServiceName }} + staticWebAppName: ${{ steps.bicep_deploy.outputs.staticWebAppName }} + 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 }} swaLocation=${{ secrets.AZURE_SWA_REGION }} identifier=${{ vars.AZURE_RESOURCE_IDENTIFIER }} + resourceGroupName: ${{ env.AZURE_RG_NAME }} deploy_backend: runs-on: ubuntu-latest needs: deploy_infrastructure From 76c1e0728f232f4339d81760bcc17e5cc6d7187b Mon Sep 17 00:00:00 2001 From: Hugo Date: Tue, 20 Jan 2026 11:28:25 +0100 Subject: [PATCH 16/41] =?UTF-8?q?j'ai=20retir=C3=A9=20une=20ligne=20en=20t?= =?UTF-8?q?rop=20dans=20le=20fichier=20deploy-infra-and-app-PR.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy-infra-and-app-PR.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/deploy-infra-and-app-PR.yml b/.github/workflows/deploy-infra-and-app-PR.yml index 0d1d2ef2..bc47116c 100644 --- a/.github/workflows/deploy-infra-and-app-PR.yml +++ b/.github/workflows/deploy-infra-and-app-PR.yml @@ -1,4 +1,3 @@ - on: pull_request: workflow_dispatch: From 0dbfbdd4265e6f3667cf70d0bcc9b5e51db2ec46 Mon Sep 17 00:00:00 2001 From: Hugo Date: Tue, 20 Jan 2026 11:34:11 +0100 Subject: [PATCH 17/41] small bug fix (merci dodo) --- .github/workflows/deploy-infra-and-app-PR.yml | 159 ++++-------------- 1 file changed, 32 insertions(+), 127 deletions(-) diff --git a/.github/workflows/deploy-infra-and-app-PR.yml b/.github/workflows/deploy-infra-and-app-PR.yml index bc47116c..27d4fd85 100644 --- a/.github/workflows/deploy-infra-and-app-PR.yml +++ b/.github/workflows/deploy-infra-and-app-PR.yml @@ -1,128 +1,33 @@ -on: - pull_request: - 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 - outputs: - appServiceName: ${{ steps.bicep_deploy.outputs.appServiceName }} - staticWebAppName: ${{ steps.bicep_deploy.outputs.staticWebAppName }} - 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 }} swaLocation=${{ secrets.AZURE_SWA_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 - # 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 }} - - # Login to Azure - # ... - - - 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 - - # Deploy frontend to Static Web App - # ... - - - 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 - skip_api_build: true - deploy_lint: - runs-on: ubuntu-latest - needs: deploy_infrastructure - environment: production - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Build Lint - run: node run eslint.config.js - working-directory: ./frontend \ No newline at end of file + build-reactapp-lint-frontend-job: + runs-on: ubuntu-latest + environment: production + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Build the react app - production mode + run: npm install && npm run build + working-directory: ./frontend + + - name: Run the linting script + run: npm run lint + working-directory: ./frontend + + build-dotnet-app-release-backend-job: + runs-on: ubuntu-latest + 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: Build the dotnet app in release mode + run: dotnet build --configuration Release + working-directory: ./backend \ No newline at end of file From 6d41084718b5cf161cf0b397279c9c19bd011f3d Mon Sep 17 00:00:00 2001 From: Hugo Date: Tue, 20 Jan 2026 11:36:40 +0100 Subject: [PATCH 18/41] tes nul dodo --- .github/workflows/deploy-infra-and-app-PR.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/deploy-infra-and-app-PR.yml b/.github/workflows/deploy-infra-and-app-PR.yml index 27d4fd85..bee63f58 100644 --- a/.github/workflows/deploy-infra-and-app-PR.yml +++ b/.github/workflows/deploy-infra-and-app-PR.yml @@ -1,3 +1,5 @@ +on: [pull_request workflow_dispatch] + jobs: build-reactapp-lint-frontend-job: runs-on: ubuntu-latest From c34a81023b751adbb25f849e634afc61bc82511f Mon Sep 17 00:00:00 2001 From: Hugo Date: Tue, 20 Jan 2026 11:37:41 +0100 Subject: [PATCH 19/41] je fais nimp --- .github/workflows/deploy-infra-and-app-PR.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-infra-and-app-PR.yml b/.github/workflows/deploy-infra-and-app-PR.yml index bee63f58..a50e9006 100644 --- a/.github/workflows/deploy-infra-and-app-PR.yml +++ b/.github/workflows/deploy-infra-and-app-PR.yml @@ -1,4 +1,4 @@ -on: [pull_request workflow_dispatch] +on: [pull_request, workflow_dispatch] jobs: build-reactapp-lint-frontend-job: From de207765815b5df66bd71972455c95d59fc9e54f Mon Sep 17 00:00:00 2001 From: Hugo Date: Tue, 20 Jan 2026 11:55:03 +0100 Subject: [PATCH 20/41] create CI pipe, --- .github/workflows/CICDPipe.yml | 31 +++++++++++++++++++ .github/workflows/deploy-infra-and-app-PR.yml | 4 ++- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/CICDPipe.yml diff --git a/.github/workflows/CICDPipe.yml b/.github/workflows/CICDPipe.yml new file mode 100644 index 00000000..2273e60a --- /dev/null +++ b/.github/workflows/CICDPipe.yml @@ -0,0 +1,31 @@ +on: [release, workflow_dispatch] + +jobs: + build-reactapp-lint-frontend-job: + runs-on: ubuntu-latest + environment: production + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Build the react app - production mode + run: npm install && npm run build + working-directory: ./frontend + + create-artifact-frontend-job: + runs-on: ubuntu-latest + needs: build-reactapp-lint-frontend-job + environment: production + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Create artifact for frontend + uses: actions/upload-artifact@v3 + with: + name: frontend-artifact + + + \ No newline at end of file diff --git a/.github/workflows/deploy-infra-and-app-PR.yml b/.github/workflows/deploy-infra-and-app-PR.yml index a50e9006..f0b86ab1 100644 --- a/.github/workflows/deploy-infra-and-app-PR.yml +++ b/.github/workflows/deploy-infra-and-app-PR.yml @@ -32,4 +32,6 @@ jobs: - name: Build the dotnet app in release mode run: dotnet build --configuration Release - working-directory: ./backend \ No newline at end of file + working-directory: ./backend + + \ No newline at end of file From b29dbec2ef107aa72f38b48f253328f07a409c2d Mon Sep 17 00:00:00 2001 From: Hugo Date: Tue, 20 Jan 2026 12:02:14 +0100 Subject: [PATCH 21/41] je test un truc --- .github/workflows/CICDPipe.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/CICDPipe.yml b/.github/workflows/CICDPipe.yml index 2273e60a..aa4b9842 100644 --- a/.github/workflows/CICDPipe.yml +++ b/.github/workflows/CICDPipe.yml @@ -22,10 +22,10 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Create artifact for frontend - uses: actions/upload-artifact@v3 - with: - name: frontend-artifact + steps: + - publish: ./frontend + artifact: FrontendArtifact + \ No newline at end of file From 09ecd94a6f447ab35e057981c4d364ab353fd5c1 Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 21 Jan 2026 14:03:06 +0100 Subject: [PATCH 22/41] creation de la pipiline cicd --- .github/workflows/deploy-infra-and-app-PR.yml | 9 ++++- .github/workflows/deploy-infra-and-apps.yml | 40 ++++++++++++++++++- 2 files changed, 45 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy-infra-and-app-PR.yml b/.github/workflows/deploy-infra-and-app-PR.yml index f0b86ab1..e7d6ab7e 100644 --- a/.github/workflows/deploy-infra-and-app-PR.yml +++ b/.github/workflows/deploy-infra-and-app-PR.yml @@ -1,4 +1,4 @@ -on: [pull_request, workflow_dispatch] + jobs: build-reactapp-lint-frontend-job: @@ -34,4 +34,9 @@ jobs: run: dotnet build --configuration Release working-directory: ./backend - \ No newline at end of file + deploy_infrastructure: + runs-on: ubuntu-latest + needs : build-dotnet-app-release-backend-job # Ensure this job runs after the pull_request job + environment: production + + diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index 8e3fab60..501343d7 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -14,14 +14,47 @@ permissions: id-token: write - - + env: AZURE_RG_NAME: rg-${{ vars.PROJECT_NAME }}-${{ vars.AZURE_RESOURCE_IDENTIFIER }} jobs: + build-reactapp-lint-frontend-job: + runs-on: ubuntu-latest + environment: production + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Build the react app - production mode + run: npm install && npm run build + working-directory: ./frontend + + - name: Run the linting script + run: npm run lint + working-directory: ./frontend + + build-dotnet-app-release-backend-job: + runs-on: ubuntu-latest + 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: Build the dotnet app in release mode + run: dotnet build --configuration Release + working-directory: ./backend + deploy_infrastructure: runs-on: ubuntu-latest + needs : build-dotnet-app-release-backend-job # Ensure this job runs after the pull_request job environment: production # bind the job to the production environment outputs: appServiceName: ${{ steps.bicep_deploy.outputs.appServiceName }} @@ -123,3 +156,6 @@ jobs: action: upload skip_app_build: true skip_api_build: true + + + deploy_infrastructure \ No newline at end of file From 55ae7864ec0b9dce8c2412023080d7ba54c8052f Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 21 Jan 2026 14:04:19 +0100 Subject: [PATCH 23/41] fixed the CICD pipeline deployment jobs --- .github/workflows/deploy-infra-and-apps.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index 501343d7..8510fdc5 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -157,5 +157,3 @@ jobs: skip_app_build: true skip_api_build: true - - deploy_infrastructure \ No newline at end of file From 93131776fdba43a3ae346e4d42daf91351659445 Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 21 Jan 2026 14:07:02 +0100 Subject: [PATCH 24/41] dunno i just removec some blank lines and a commented on --- .github/workflows/deploy-infra-and-apps.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index 8510fdc5..b0840739 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -3,10 +3,7 @@ on: tags: - 'v[0-9].[0-9].[0-9]' workflow_dispatch: -# on -# ... - - + permissions: # Require write permission to Fetch an OIDC token (required for federated credential) and write it From 9c106a2d2990f4f3948e79ae21c5bbeca0b34bb9 Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 21 Jan 2026 14:15:20 +0100 Subject: [PATCH 25/41] en mettant les artefact c'est mieux --- .github/workflows/deploy-infra-and-apps.yml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index b0840739..d6006ea4 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -3,7 +3,7 @@ on: tags: - 'v[0-9].[0-9].[0-9]' workflow_dispatch: - + permissions: # Require write permission to Fetch an OIDC token (required for federated credential) and write it @@ -28,9 +28,11 @@ jobs: run: npm install && npm run build working-directory: ./frontend - - name: Run the linting script - run: npm run lint - working-directory: ./frontend + - name: 'Createa artefact frontend' + uses: actions/upload-artifact@v4 + with: + name: react-frontend-build + path : ./frontend build-dotnet-app-release-backend-job: runs-on: ubuntu-latest @@ -49,6 +51,13 @@ jobs: run: dotnet build --configuration Release working-directory: ./backend + + - name: 'Create artefact' + uses: actions/upload-artifact@v4 + with: + name: dotnet-backend-build + path : ./backend + deploy_infrastructure: runs-on: ubuntu-latest needs : build-dotnet-app-release-backend-job # Ensure this job runs after the pull_request job @@ -82,6 +91,8 @@ jobs: template: ./infrastructure/main.bicep 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: runs-on: ubuntu-latest needs: deploy_infrastructure From d07a834a12d4dbe837c813c1d953dabd2a832f33 Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 21 Jan 2026 14:16:46 +0100 Subject: [PATCH 26/41] avec d'autres fichiers qui plantent aussi... --- .github/workflows/deploy-infra-and-app-PR.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-infra-and-app-PR.yml b/.github/workflows/deploy-infra-and-app-PR.yml index e7d6ab7e..b555b544 100644 --- a/.github/workflows/deploy-infra-and-app-PR.yml +++ b/.github/workflows/deploy-infra-and-app-PR.yml @@ -1,5 +1,8 @@ - +on: + pull_request: + branches: + - main jobs: build-reactapp-lint-frontend-job: runs-on: ubuntu-latest @@ -39,4 +42,3 @@ jobs: needs : build-dotnet-app-release-backend-job # Ensure this job runs after the pull_request job environment: production - From e0aa52de6902812538161378a6d540008ad8b13d Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 21 Jan 2026 14:17:47 +0100 Subject: [PATCH 27/41] yen a marre de ce fichier --- .github/workflows/deploy-infra-and-app-PR.yml | 84 +++++++++---------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/.github/workflows/deploy-infra-and-app-PR.yml b/.github/workflows/deploy-infra-and-app-PR.yml index b555b544..a2dd3c2d 100644 --- a/.github/workflows/deploy-infra-and-app-PR.yml +++ b/.github/workflows/deploy-infra-and-app-PR.yml @@ -1,44 +1,44 @@ -on: - pull_request: - branches: - - main -jobs: - build-reactapp-lint-frontend-job: - runs-on: ubuntu-latest - environment: production - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Build the react app - production mode - run: npm install && npm run build - working-directory: ./frontend - - - name: Run the linting script - run: npm run lint - working-directory: ./frontend - - build-dotnet-app-release-backend-job: - runs-on: ubuntu-latest - 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: Build the dotnet app in release mode - run: dotnet build --configuration Release - working-directory: ./backend - - deploy_infrastructure: - runs-on: ubuntu-latest - needs : build-dotnet-app-release-backend-job # Ensure this job runs after the pull_request job - environment: production +# on: +# pull_request: +# branches: +# - main +# jobs: +# build-reactapp-lint-frontend-job: +# runs-on: ubuntu-latest +# environment: production + +# steps: +# - name: Checkout repository +# uses: actions/checkout@v4 + +# - name: Build the react app - production mode +# run: npm install && npm run build +# working-directory: ./frontend + +# - name: Run the linting script +# run: npm run lint +# working-directory: ./frontend + +# build-dotnet-app-release-backend-job: +# runs-on: ubuntu-latest +# 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: Build the dotnet app in release mode +# run: dotnet build --configuration Release +# working-directory: ./backend + +# deploy_infrastructure: +# runs-on: ubuntu-latest +# needs : build-dotnet-app-release-backend-job # Ensure this job runs after the pull_request job +# environment: production From 247c4ced2f1dac0c9b99cb2ef9990ae64160f075 Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 21 Jan 2026 14:21:15 +0100 Subject: [PATCH 28/41] encore un fichier de con qui membete --- .github/workflows/CICDPipe.yml | 42 +++++++++++++++++----------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/workflows/CICDPipe.yml b/.github/workflows/CICDPipe.yml index aa4b9842..01e46aa1 100644 --- a/.github/workflows/CICDPipe.yml +++ b/.github/workflows/CICDPipe.yml @@ -1,30 +1,30 @@ -on: [release, workflow_dispatch] +# on: [release, workflow_dispatch] -jobs: - build-reactapp-lint-frontend-job: - runs-on: ubuntu-latest - environment: production +# jobs: +# build-reactapp-lint-frontend-job: +# runs-on: ubuntu-latest +# environment: production - steps: - - name: Checkout repository - uses: actions/checkout@v4 +# steps: +# - name: Checkout repository +# uses: actions/checkout@v4 - - name: Build the react app - production mode - run: npm install && npm run build - working-directory: ./frontend +# - name: Build the react app - production mode +# run: npm install && npm run build +# working-directory: ./frontend - create-artifact-frontend-job: - runs-on: ubuntu-latest - needs: build-reactapp-lint-frontend-job - environment: production +# create-artifact-frontend-job: +# runs-on: ubuntu-latest +# needs: build-reactapp-lint-frontend-job +# environment: production - steps: - - name: Checkout repository - uses: actions/checkout@v4 +# steps: +# - name: Checkout repository +# uses: actions/checkout@v4 - steps: - - publish: ./frontend - artifact: FrontendArtifact +# steps: +# - publish: ./frontend +# artifact: FrontendArtifact From 94d7551ca2e3013213c4c9730938eb54789fff0d Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 21 Jan 2026 14:24:57 +0100 Subject: [PATCH 29/41] jen sais rien de ce que je fais la --- .github/workflows/CICDPipe.yml | 31 ------- .github/workflows/deploy-infra-and-app-PR.yml | 85 +++++++++---------- 2 files changed, 42 insertions(+), 74 deletions(-) delete mode 100644 .github/workflows/CICDPipe.yml diff --git a/.github/workflows/CICDPipe.yml b/.github/workflows/CICDPipe.yml deleted file mode 100644 index 01e46aa1..00000000 --- a/.github/workflows/CICDPipe.yml +++ /dev/null @@ -1,31 +0,0 @@ -# on: [release, workflow_dispatch] - -# jobs: -# build-reactapp-lint-frontend-job: -# runs-on: ubuntu-latest -# environment: production - -# steps: -# - name: Checkout repository -# uses: actions/checkout@v4 - -# - name: Build the react app - production mode -# run: npm install && npm run build -# working-directory: ./frontend - -# create-artifact-frontend-job: -# runs-on: ubuntu-latest -# needs: build-reactapp-lint-frontend-job -# environment: production - -# steps: -# - name: Checkout repository -# uses: actions/checkout@v4 - -# steps: -# - publish: ./frontend -# artifact: FrontendArtifact - - - - \ No newline at end of file diff --git a/.github/workflows/deploy-infra-and-app-PR.yml b/.github/workflows/deploy-infra-and-app-PR.yml index a2dd3c2d..5a8e55bd 100644 --- a/.github/workflows/deploy-infra-and-app-PR.yml +++ b/.github/workflows/deploy-infra-and-app-PR.yml @@ -1,44 +1,43 @@ - -# on: -# pull_request: -# branches: -# - main -# jobs: -# build-reactapp-lint-frontend-job: -# runs-on: ubuntu-latest -# environment: production - -# steps: -# - name: Checkout repository -# uses: actions/checkout@v4 - -# - name: Build the react app - production mode -# run: npm install && npm run build -# working-directory: ./frontend - -# - name: Run the linting script -# run: npm run lint -# working-directory: ./frontend - -# build-dotnet-app-release-backend-job: -# runs-on: ubuntu-latest -# 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: Build the dotnet app in release mode -# run: dotnet build --configuration Release -# working-directory: ./backend - -# deploy_infrastructure: -# runs-on: ubuntu-latest -# needs : build-dotnet-app-release-backend-job # Ensure this job runs after the pull_request job -# environment: production +on: + pull_request: + branches: + - main +jobs: + build-reactapp-lint-frontend-job: + runs-on: ubuntu-latest + environment: production + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Build the react app - production mode + run: npm install && npm run build + working-directory: ./frontend + + - name: Run the linting script + run: npm run lint + working-directory: ./frontend + + build-dotnet-app-release-backend-job: + runs-on: ubuntu-latest + 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: Build the dotnet app in release mode + run: dotnet build --configuration Release + working-directory: ./backend + + deploy_infrastructure: + runs-on: ubuntu-latest + needs : build-dotnet-app-release-backend-job # Ensure this job runs after the pull_request job + environment: production From af7555777ca17e094ee59a1d4cce65d032458b23 Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 21 Jan 2026 14:26:21 +0100 Subject: [PATCH 30/41] j'avais un truc de trop dans deploy infra pr --- .github/workflows/deploy-infra-and-app-PR.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/deploy-infra-and-app-PR.yml b/.github/workflows/deploy-infra-and-app-PR.yml index 5a8e55bd..d71ed925 100644 --- a/.github/workflows/deploy-infra-and-app-PR.yml +++ b/.github/workflows/deploy-infra-and-app-PR.yml @@ -36,8 +36,5 @@ jobs: run: dotnet build --configuration Release working-directory: ./backend - deploy_infrastructure: - runs-on: ubuntu-latest - needs : build-dotnet-app-release-backend-job # Ensure this job runs after the pull_request job - environment: production + From 0c16031344ff5eaaf19d350193179ae293b24aa0 Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 21 Jan 2026 14:43:28 +0100 Subject: [PATCH 31/41] mise en parallele --- .github/workflows/deploy-infra-and-apps.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index d6006ea4..04686d52 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -60,7 +60,7 @@ jobs: deploy_infrastructure: runs-on: ubuntu-latest - needs : build-dotnet-app-release-backend-job # Ensure this job runs after the pull_request job + needs : [build-dotnet-app-release-backend-job, build-reactapp-lint-frontend-job] # Ensure this job runs after the pull_request job environment: production # bind the job to the production environment outputs: appServiceName: ${{ steps.bicep_deploy.outputs.appServiceName }} @@ -107,8 +107,11 @@ jobs: 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 + - name : Deploy artefact backend + uses : actions/download-artifact@v4 + with : + name : dotnet-backend-build + path: ./backend working-directory: ./backend # Specify where to find the solution file in repository - name: Login to Azure @@ -134,10 +137,13 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Build the app - run: npm install && npm run build - working-directory: ./frontend + - name : Deploy artefact frontend + uses : actions/download-artifact@v4 + with : + name : frontend-build + path: ./frontend + - name: Login to Azure uses: azure/login@v2 with: From f661840746cc4f8dc90c301e1bd01220385c9e14 Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 21 Jan 2026 14:47:56 +0100 Subject: [PATCH 32/41] je fix un truc en mettant exactemetn la meme chose --- .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 04686d52..9f5d7f76 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -60,7 +60,7 @@ jobs: deploy_infrastructure: runs-on: ubuntu-latest - needs : [build-dotnet-app-release-backend-job, build-reactapp-lint-frontend-job] # Ensure this job runs after the pull_request job + needs : [build-dotnet-app-release-backend-job, build-reactapp-lint-frontend-job] # Ensure this job runs after the pull_request job environment: production # bind the job to the production environment outputs: appServiceName: ${{ steps.bicep_deploy.outputs.appServiceName }} From 505dadd8dfca5513713e24a5041f3c1dd7cc7ead Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 21 Jan 2026 14:50:02 +0100 Subject: [PATCH 33/41] ils seront pas en parrelle et c'est tres bien comme ca --- .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 9f5d7f76..08d8f225 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -60,7 +60,7 @@ jobs: deploy_infrastructure: runs-on: ubuntu-latest - needs : [build-dotnet-app-release-backend-job, build-reactapp-lint-frontend-job] # Ensure this job runs after the pull_request job + needs : build-dotnet-app-release-backend-job # Ensure this job runs after the pull_request job environment: production # bind the job to the production environment outputs: appServiceName: ${{ steps.bicep_deploy.outputs.appServiceName }} From 2fb8d771b5e656489be9f9b4c68c8e77062a1de2 Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 21 Jan 2026 15:16:44 +0100 Subject: [PATCH 34/41] fixed indenation --- .github/workflows/deploy-infra-and-apps.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index 08d8f225..ea65e5d9 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -60,7 +60,7 @@ jobs: deploy_infrastructure: runs-on: ubuntu-latest - needs : build-dotnet-app-release-backend-job # Ensure this job runs after the pull_request job + needs : [build-dotnet-app-release-backend-job, build-reactapp-lint-frontend-job] # Ensure this job runs after the pull_request job environment: production # bind the job to the production environment outputs: appServiceName: ${{ steps.bicep_deploy.outputs.appServiceName }} @@ -137,7 +137,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name : Deploy artefact frontend + - name : Deploy artefact frontend uses : actions/download-artifact@v4 with : name : frontend-build From 62fd2ef9bcc29289c90f8400da7422cc7853fdde Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 21 Jan 2026 15:18:02 +0100 Subject: [PATCH 35/41] indenation 115 --- .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 ea65e5d9..4cd15cb1 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -112,7 +112,7 @@ jobs: with : name : dotnet-backend-build path: ./backend - working-directory: ./backend # Specify where to find the solution file in repository + working-directory: ./backend # Specify where to find the solution file in repository - name: Login to Azure uses: azure/login@v2 From a276c1644f706fa7f5b6cf281d2de7d8e8c418b7 Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 21 Jan 2026 15:24:34 +0100 Subject: [PATCH 36/41] changed frontent deployment name --- .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 4cd15cb1..8452fb19 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -140,7 +140,7 @@ jobs: - name : Deploy artefact frontend uses : actions/download-artifact@v4 with : - name : frontend-build + name : react-frontend-build path: ./frontend From 38660893f006f534e7e946b547ff5d99119c6b58 Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 21 Jan 2026 15:29:59 +0100 Subject: [PATCH 37/41] removed paths --- .github/workflows/deploy-infra-and-apps.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index 8452fb19..54deb09a 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -32,7 +32,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: react-frontend-build - path : ./frontend + build-dotnet-app-release-backend-job: runs-on: ubuntu-latest @@ -56,7 +56,6 @@ jobs: uses: actions/upload-artifact@v4 with: name: dotnet-backend-build - path : ./backend deploy_infrastructure: runs-on: ubuntu-latest @@ -111,7 +110,7 @@ jobs: uses : actions/download-artifact@v4 with : name : dotnet-backend-build - path: ./backend + working-directory: ./backend # Specify where to find the solution file in repository - name: Login to Azure @@ -141,7 +140,7 @@ jobs: uses : actions/download-artifact@v4 with : name : react-frontend-build - path: ./frontend + - name: Login to Azure From db17fe80c01b3c8143d21d8ba14869642415ffaf Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 21 Jan 2026 15:34:01 +0100 Subject: [PATCH 38/41] remis le path dans le build --- .github/workflows/deploy-infra-and-apps.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index 54deb09a..90372280 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -32,7 +32,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: react-frontend-build - + path : ./frontend build-dotnet-app-release-backend-job: runs-on: ubuntu-latest @@ -110,7 +110,7 @@ jobs: uses : actions/download-artifact@v4 with : name : dotnet-backend-build - + working-directory: ./backend # Specify where to find the solution file in repository - name: Login to Azure From e5606bfb43d3da37f3a9304f9629454fa80f2384 Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 21 Jan 2026 15:36:35 +0100 Subject: [PATCH 39/41] changed some paths --- .github/workflows/deploy-infra-and-apps.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index 90372280..5d49de21 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -56,6 +56,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: dotnet-backend-build + path : ./backend deploy_infrastructure: runs-on: ubuntu-latest @@ -111,7 +112,7 @@ jobs: with : name : dotnet-backend-build - working-directory: ./backend # Specify where to find the solution file in repository + - name: Login to Azure uses: azure/login@v2 From 4cc6f176c8c50d56fdb8204020ad652d409bf798 Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 21 Jan 2026 15:42:39 +0100 Subject: [PATCH 40/41] test app location --- .github/workflows/deploy-infra-and-apps.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index 5d49de21..e291efee 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -112,7 +112,7 @@ jobs: with : name : dotnet-backend-build - + - name: Login to Azure uses: azure/login@v2 @@ -166,7 +166,7 @@ jobs: uses: azure/static-web-apps-deploy@v1 with: azure_static_web_apps_api_token: ${{ env.SWA_DEPLOYMENT_TOKEN }} - app_location: frontend/dist + app_location: ./frontend action: upload skip_app_build: true skip_api_build: true From b0296838324e417dcd42c5400bad03fdbeebaa85 Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 21 Jan 2026 15:50:23 +0100 Subject: [PATCH 41/41] changement de version artefact --- .github/workflows/deploy-infra-and-apps.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index e291efee..a270fdfb 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -108,9 +108,10 @@ jobs: dotnet-version: '9.0.x' - name : Deploy artefact backend - uses : actions/download-artifact@v4 + uses : actions/download-artifact@v5 with : name : dotnet-backend-build + path : ./backend @@ -125,7 +126,7 @@ 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 + package: ./backend # deploy_infrastructure ... deploy_frontend: @@ -138,9 +139,10 @@ jobs: uses: actions/checkout@v4 - name : Deploy artefact frontend - uses : actions/download-artifact@v4 + uses : actions/download-artifact@v5 with : name : react-frontend-build + path : ./frontend