From b8b202a04863ae267ad4cae9374faaab76319393 Mon Sep 17 00:00:00 2001 From: Oumaima741 Date: Wed, 14 Jan 2026 10:49:36 +0100 Subject: [PATCH 01/40] step1 --- .github/workflows/deploy-infra-and-apps.yml | 35 +++++++++++++++++++++ infrastructure/main.bicep | 32 +++++++++++++++++++ infrastructure/modules/appService.bicep | 22 +++++++++++++ infrastructure/modules/appServicePlan.bicep | 20 ++++++++++++ 4 files changed, 109 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..7b6de93d --- /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 }} \ No newline at end of file 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/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 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 daea2e350ac2b027e45fcb6c02a1388729232c4a Mon Sep 17 00:00:00 2001 From: Oumaima741 Date: Tue, 20 Jan 2026 14:30:44 +0100 Subject: [PATCH 02/40] commit step1 --- .github/workflows/deploy-infra-and-apps.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index 7b6de93d..8ca559f8 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -1,11 +1,15 @@ 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 steps: - name: Checkout repository @@ -32,4 +36,4 @@ 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 }} From c8157fd3fadd2f135dfa65194b0db52a51e779f7 Mon Sep 17 00:00:00 2001 From: Oumaima741 Date: Tue, 20 Jan 2026 14:37:49 +0100 Subject: [PATCH 03/40] commit step1 meth2 --- .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 8ca559f8..76ff2af3 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -1,39 +1,39 @@ 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: + contents: read + +env: AZURE_RG_NAME: rg-${{ vars.PROJECT_NAME }}-${{ vars.AZURE_RESOURCE_IDENTIFIER }} - + jobs: deploy_infrastructure: runs-on: ubuntu-latest - environment: production + environment: production steps: - - name: Checkout repository - uses: actions/checkout@v4 + - 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: 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: 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: Create resource group if not exists + run: | + if ! az group show --name "${{ env.AZURE_RG_NAME }}" >/dev/null 2>&1; then + az group create --name "${{ env.AZURE_RG_NAME }}" --location "${{ secrets.AZURE_REGION }}" + fi - - 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 }} + - name: Deploy bicep + id: bicep_deploy + uses: azure/arm-deploy@v2 + with: + subscriptionId: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + resourceGroupName: ${{ env.AZURE_RG_NAME }} + template: ./infrastructure/main.bicep + parameters: project=${{ vars.PROJECT_NAME }} location=${{ secrets.AZURE_REGION }} identifier=${{ vars.AZURE_RESOURCE_IDENTIFIER }} From 04ded0554e7f0f130b344c330deab4f3f1fc3307 Mon Sep 17 00:00:00 2001 From: Oumaima741 Date: Tue, 20 Jan 2026 14:40:06 +0100 Subject: [PATCH 04/40] commit step1 --- .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 76ff2af3..8ca559f8 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -1,39 +1,39 @@ 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 - contents: read - -env: +env: AZURE_RG_NAME: rg-${{ vars.PROJECT_NAME }}-${{ vars.AZURE_RESOURCE_IDENTIFIER }} - + jobs: deploy_infrastructure: runs-on: ubuntu-latest - environment: production + environment: production steps: - - name: Checkout repository - uses: actions/checkout@v4 + - 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 }} + - 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: | - if ! az group show --name "${{ env.AZURE_RG_NAME }}" >/dev/null 2>&1; then - az group create --name "${{ env.AZURE_RG_NAME }}" --location "${{ secrets.AZURE_REGION }}" - fi + - 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_ID }} - resourceGroupName: ${{ env.AZURE_RG_NAME }} - template: ./infrastructure/main.bicep - parameters: project=${{ vars.PROJECT_NAME }} location=${{ secrets.AZURE_REGION }} identifier=${{ vars.AZURE_RESOURCE_IDENTIFIER }} + - 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 836aec43e5de61a9923b9109f8bc4e7d51164fab Mon Sep 17 00:00:00 2001 From: Oumaima741 Date: Tue, 20 Jan 2026 14:45:31 +0100 Subject: [PATCH 05/40] rydy --- .github/workflows/deploy-infra-and-apps.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index 8ca559f8..dc8da85d 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -1,15 +1,17 @@ on: [push, workflow_dispatch] + +env: + AZURE_RG_NAME: rg-${{ vars.PROJECT_NAME }}-${{ vars.AZURE_RESOURCE_IDENTIFIER }} + 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 + environment: production steps: - name: Checkout repository From 0d99c816445eefd39d7abe82f63ac4452f2047b2 Mon Sep 17 00:00:00 2001 From: Oumaima741 Date: Tue, 20 Jan 2026 14:53:10 +0100 Subject: [PATCH 06/40] step1 --- .github/workflows/deploy-infra-and-apps.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index dc8da85d..185f4a3e 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -2,10 +2,8 @@ on: [push, workflow_dispatch] env: AZURE_RG_NAME: rg-${{ vars.PROJECT_NAME }}-${{ vars.AZURE_RESOURCE_IDENTIFIER }} - + 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 jobs: From bd793999088fae0c5284712f83b38cd044e93bcd Mon Sep 17 00:00:00 2001 From: Oumaima741 Date: Tue, 20 Jan 2026 15:03:38 +0100 Subject: [PATCH 07/40] step --- .github/workflows/deploy-infra-and-apps.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index 185f4a3e..4752bb2d 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -1,5 +1,4 @@ on: [push, workflow_dispatch] - env: AZURE_RG_NAME: rg-${{ vars.PROJECT_NAME }}-${{ vars.AZURE_RESOURCE_IDENTIFIER }} From c34926da70e34f724198ebfccfabba20fd4b9804 Mon Sep 17 00:00:00 2001 From: Oumaima741 Date: Tue, 20 Jan 2026 15:05:53 +0100 Subject: [PATCH 08/40] step --- .github/workflows/deploy-infra-and-apps.yml | 65 ++++++++++++--------- 1 file changed, 38 insertions(+), 27 deletions(-) diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index 4752bb2d..a990bcba 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -1,9 +1,12 @@ on: [push, workflow_dispatch] -env: + +env: AZURE_RG_NAME: rg-${{ vars.PROJECT_NAME }}-${{ vars.AZURE_RESOURCE_IDENTIFIER }} - + AZURE_LOCATION: ${{ secrets.AZURE_REGION }} + permissions: id-token: write + contents: read jobs: deploy_infrastructure: @@ -11,28 +14,36 @@ jobs: environment: production 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 }} + - 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 }} + + - name: Create resource group if not exists + shell: bash + run: | + set -euo pipefail + echo "RG: $AZURE_RG_NAME" + echo "Location: $AZURE_LOCATION" + + if [ "$(az group exists --name "$AZURE_RG_NAME")" = "false" ]; then + az group create --name "$AZURE_RG_NAME" --location "$AZURE_LOCATION" + else + echo "Resource group already exists." + fi + + - name: Deploy bicep + uses: azure/arm-deploy@v2 + with: + subscriptionId: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + resourceGroupName: ${{ env.AZURE_RG_NAME }} + template: ./infrastructure/main.bicep + parameters: > + project=${{ vars.PROJECT_NAME }} + location=${{ secrets.AZURE_REGION }} + identifier=${{ vars.AZURE_RESOURCE_IDENTIFIER }} From ca19f722d61743db19b94b2edaf0e6ac10c22dc4 Mon Sep 17 00:00:00 2001 From: Oumaima741 Date: Tue, 20 Jan 2026 15:10:50 +0100 Subject: [PATCH 09/40] fix --- .github/workflows/deploy-infra-and-apps.yml | 65 +++++++++------------ 1 file changed, 27 insertions(+), 38 deletions(-) diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index a990bcba..4752bb2d 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -1,12 +1,9 @@ on: [push, workflow_dispatch] - -env: +env: AZURE_RG_NAME: rg-${{ vars.PROJECT_NAME }}-${{ vars.AZURE_RESOURCE_IDENTIFIER }} - AZURE_LOCATION: ${{ secrets.AZURE_REGION }} - + permissions: id-token: write - contents: read jobs: deploy_infrastructure: @@ -14,36 +11,28 @@ jobs: environment: production 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 }} - - - name: Create resource group if not exists - shell: bash - run: | - set -euo pipefail - echo "RG: $AZURE_RG_NAME" - echo "Location: $AZURE_LOCATION" - - if [ "$(az group exists --name "$AZURE_RG_NAME")" = "false" ]; then - az group create --name "$AZURE_RG_NAME" --location "$AZURE_LOCATION" - else - echo "Resource group already exists." - fi - - - name: Deploy bicep - uses: azure/arm-deploy@v2 - with: - subscriptionId: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - resourceGroupName: ${{ env.AZURE_RG_NAME }} - template: ./infrastructure/main.bicep - parameters: > - project=${{ vars.PROJECT_NAME }} - location=${{ secrets.AZURE_REGION }} - identifier=${{ vars.AZURE_RESOURCE_IDENTIFIER }} + - 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 960655e16c8e4b4ce26286b2b48c66ae6b9dac14 Mon Sep 17 00:00:00 2001 From: Oumaima741 Date: Tue, 20 Jan 2026 15:12:52 +0100 Subject: [PATCH 10/40] 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 4752bb2d..e87abcaa 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -22,7 +22,7 @@ jobs: subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} enable-AzPSSession: true - - name: Create resource group if not exists + - 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 }} From 762412cd137dbb99e5c78184a0e32a7c7d201d6e Mon Sep 17 00:00:00 2001 From: Oumaima741 Date: Tue, 20 Jan 2026 15:29:54 +0100 Subject: [PATCH 11/40] backend --- .github/workflows/deploy-infra-and-apps.yml | 65 +++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index e87abcaa..752e92fb 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -9,6 +9,8 @@ jobs: deploy_infrastructure: runs-on: ubuntu-latest environment: production + outputs: + appServiceName: ${{ steps.bicep_deploy.outputs.appServiceName }} steps: - name: Checkout repository @@ -36,3 +38,66 @@ 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 +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 5704848b1fe2cbe82a4d065471ce55c3742bb2d4 Mon Sep 17 00:00:00 2001 From: Oumaima741 Date: Tue, 20 Jan 2026 15:33:03 +0100 Subject: [PATCH 12/40] backend --- .github/workflows/deploy-infra-and-apps.yml | 31 --------------------- 1 file changed, 31 deletions(-) diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index 752e92fb..81e7c913 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -68,36 +68,5 @@ deploy_backend: 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_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 18b14a557b2bde302fc830a806cdaf57ab18f4fb Mon Sep 17 00:00:00 2001 From: Oumaima741 Date: Tue, 20 Jan 2026 15:36:35 +0100 Subject: [PATCH 13/40] backendfinaly --- .github/workflows/deploy-infra-and-apps.yml | 58 ++++++++++----------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index 81e7c913..044b3501 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -38,35 +38,35 @@ 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: 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 + - 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 + \ No newline at end of file From 794abbceef575cacc29d6169335773492faf0871 Mon Sep 17 00:00:00 2001 From: Oumaima741 Date: Tue, 20 Jan 2026 15:57:27 +0100 Subject: [PATCH 14/40] frontend1 --- .github/workflows/deploy-infra-and-apps.yml | 2 +- infrastructure/main.bicep | 14 ++++++++++++-- infrastructure/modules/appService.bicep | 2 +- infrastructure/modules/staticWebApp.bicep | 16 ++++++++++++++++ 4 files changed, 30 insertions(+), 4 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 044b3501..289c76cf 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -36,7 +36,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 22252465..79b2ac78 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 @@ -26,7 +26,17 @@ module appService 'modules/appService.bicep' = { 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 } +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 // 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/appService.bicep b/infrastructure/modules/appService.bicep index 740e0841..40b49099 100644 --- a/infrastructure/modules/appService.bicep +++ b/infrastructure/modules/appService.bicep @@ -19,4 +19,4 @@ 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 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 f2c8549c037975ce8e178139cecd4745315c49cb Mon Sep 17 00:00:00 2001 From: Oumaima741 Date: Tue, 20 Jan 2026 16:04:54 +0100 Subject: [PATCH 15/40] frontend --- .github/workflows/deploy-infra-and-apps.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index 289c76cf..bc51dca0 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -1,4 +1,6 @@ + on: [push, workflow_dispatch] + env: AZURE_RG_NAME: rg-${{ vars.PROJECT_NAME }}-${{ vars.AZURE_RESOURCE_IDENTIFIER }} @@ -10,8 +12,7 @@ jobs: runs-on: ubuntu-latest environment: production outputs: - appServiceName: ${{ steps.bicep_deploy.outputs.appServiceName }} - + appServiceName: ${{ steps.bicep_deploy.outputs.appServiceName }} steps: - name: Checkout repository uses: actions/checkout@v4 @@ -24,7 +25,7 @@ jobs: subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} enable-AzPSSession: true - - name: Create resource group if not exists + - 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 }} @@ -38,11 +39,12 @@ 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 environment: production - + steps: - name: Checkout repository uses: actions/checkout@v4 @@ -53,7 +55,7 @@ jobs: 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 + run: dotnet publish -c Release --propertyublishDir=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 @@ -68,5 +70,3 @@ jobs: 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 30ef9265003e0f9ec4bbefbf7592516c4f03c382 Mon Sep 17 00:00:00 2001 From: Oumaima741 Date: Tue, 20 Jan 2026 16:09:09 +0100 Subject: [PATCH 16/40] frontend2 --- infrastructure/main.bicep | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/infrastructure/main.bicep b/infrastructure/main.bicep index 79b2ac78..26a1683b 100644 --- a/infrastructure/main.bicep +++ b/infrastructure/main.bicep @@ -3,10 +3,11 @@ 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 +param swaLocation string // Create the AppServicePlan through the AppServicePlan module module appServicePlan 'modules/appServicePlan.bicep' = { name: 'appServicePlan' @@ -26,6 +27,7 @@ module appService 'modules/appService.bicep' = { 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 } +} module staticWebApp 'modules/staticWebApp.bicep' = { name: 'staticWebApp' params: { @@ -34,9 +36,6 @@ module staticWebApp 'modules/staticWebApp.bicep' = { identifier: identifier } } -} -// Export App Service Name 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 - From 5eb0fae1efb6a596a4a7f4f0b94323bfc104be50 Mon Sep 17 00:00:00 2001 From: Oumaima741 Date: Tue, 20 Jan 2026 16:20:37 +0100 Subject: [PATCH 17/40] doterror --- .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 bc51dca0..2426912f 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -55,7 +55,7 @@ jobs: dotnet-version: '9.0.x' - name: Publish the app - run: dotnet publish -c Release --propertyublishDir=publish # Publish the app to the API project publish folder + run: dotnet publish -c Release -o 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 From d0fe7241b0f1c4465fa40a653a0df37a9e47ce09 Mon Sep 17 00:00:00 2001 From: Oumaima741 Date: Tue, 20 Jan 2026 16:30:20 +0100 Subject: [PATCH 18/40] front --- .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 2426912f..cd2605cb 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -55,7 +55,7 @@ jobs: dotnet-version: '9.0.x' - name: Publish the app - run: dotnet publish -c Release -o publish # Publish the app to the API project publish folder + 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 From b5177d36daadc05605cb9e3631100e44fb8ad423 Mon Sep 17 00:00:00 2001 From: Oumaima741 Date: Tue, 20 Jan 2026 16:36:22 +0100 Subject: [PATCH 19/40] erreurtest --- .github/workflows/deploy-infra-and-apps.yml | 34 +++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index cd2605cb..80d01c8e 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -13,6 +13,11 @@ jobs: environment: production outputs: appServiceName: ${{ steps.bicep_deploy.outputs.appServiceName }} + staticWebAppName: ${{ steps.bicep_deploy.outputs.staticWebAppName }} + + + + steps: - name: Checkout repository uses: actions/checkout@v4 @@ -70,3 +75,32 @@ jobs: 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 }} + + - 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 c70d3f4612c5ee7ccb46c769032030c34872e971 Mon Sep 17 00:00:00 2001 From: Oumaima741 Date: Tue, 20 Jan 2026 16:38:55 +0100 Subject: [PATCH 20/40] pushfinalfrontend --- .github/workflows/deploy-infra-and-apps.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index 80d01c8e..5b2ffec7 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -96,10 +96,21 @@ deploy_frontend: 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 7f61636794b4dfb6fd35dd74d74ecc50161c622f Mon Sep 17 00:00:00 2001 From: Oumaima741 Date: Tue, 20 Jan 2026 16:41:10 +0100 Subject: [PATCH 21/40] commitfront --- .github/workflows/deploy-infra-and-apps.yml | 70 ++++++++++----------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index 5b2ffec7..59e467ab 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -77,41 +77,41 @@ 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 + deploy_frontend: + runs-on: ubuntu-latest + needs: deploy_infrastructure + environment: production - steps: - - name: Checkout repository - uses: actions/checkout@v4 + steps: + - name: Checkout repository + uses: actions/checkout@v4 - - name: Build the app - run: npm install && npm run build - working-directory: ./frontend + - 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 \ No newline at end of file + - 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 \ No newline at end of file From 0b56186c0026e061eb7a296d6690815b08478fb6 Mon Sep 17 00:00:00 2001 From: Oumaima741 Date: Tue, 20 Jan 2026 16:47:42 +0100 Subject: [PATCH 22/40] testfinal --- infrastructure/main.bicep | 12 ++++++++++++ infrastructure/modules/appService.bicep | 3 +++ infrastructure/modules/staticWebApp.bicep | 8 ++++---- infrastructure/modules/staticWebAppBackend.bicep | 11 +++++++++++ 4 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 infrastructure/modules/staticWebAppBackend.bicep diff --git a/infrastructure/main.bicep b/infrastructure/main.bicep index 26a1683b..67cb2dcf 100644 --- a/infrastructure/main.bicep +++ b/infrastructure/main.bicep @@ -36,6 +36,18 @@ module staticWebApp 'modules/staticWebApp.bicep' = { identifier: identifier } } +// Previous resources +// ... +module staticWebAppBackend 'modules/staticWebAppBackend.bicep' = { + name: 'staticWebAppBackend' + params: { + backendBindedResourceId: appService.outputs.appServiceId + swaName: staticWebApp.outputs.swaName + location: location + } +} +// Outputs +// ... 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/appService.bicep b/infrastructure/modules/appService.bicep index 40b49099..c797e14f 100644 --- a/infrastructure/modules/appService.bicep +++ b/infrastructure/modules/appService.bicep @@ -20,3 +20,6 @@ resource app 'Microsoft.Web/sites@2022-03-01' = { } output appServiceName string = app.name // Export the App Service name for deployment +// Previous outputs +// ... +output appServiceId string = app.id diff --git a/infrastructure/modules/staticWebApp.bicep b/infrastructure/modules/staticWebApp.bicep index cd780056..290ed72c 100644 --- a/infrastructure/modules/staticWebApp.bicep +++ b/infrastructure/modules/staticWebApp.bicep @@ -6,10 +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 9d15c1e0d87528fb1b8c8388166ee2d79b27477e Mon Sep 17 00:00:00 2001 From: Oumaima741 Date: Tue, 20 Jan 2026 17:52:34 +0100 Subject: [PATCH 23/40] tag --- .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 59e467ab..cc73b71a 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -1,5 +1,10 @@ -on: [push, workflow_dispatch] +on: + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' + workflow_dispatch: + env: AZURE_RG_NAME: rg-${{ vars.PROJECT_NAME }}-${{ vars.AZURE_RESOURCE_IDENTIFIER }} @@ -9,6 +14,7 @@ permissions: jobs: deploy_infrastructure: + runs-on: ubuntu-latest environment: production outputs: From 6775131bac5767569ab1f6bdc618adb4a693c4bd Mon Sep 17 00:00:00 2001 From: Oumaima741 Date: Wed, 21 Jan 2026 08:23:19 +0100 Subject: [PATCH 24/40] tag1 --- .github/workflows/deploy-infra-and-apps.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index cc73b71a..f09110ce 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -1,4 +1,3 @@ - on: push: tags: From 64acca65128ab5b428dbd915c7373a4a6419bdc5 Mon Sep 17 00:00:00 2001 From: Oumaima741 Date: Wed, 21 Jan 2026 08:33:02 +0100 Subject: [PATCH 25/40] tagfinal --- .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 f09110ce..dadff089 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -1,7 +1,7 @@ on: push: tags: - - 'v[0-9]+.[0-9]+.[0-9]+' + - '[0-9]+.[0-9]+.[0-9]+' workflow_dispatch: From 6519fc1ec5f0840c0faf463d3a52e4fb65e61062 Mon Sep 17 00:00:00 2001 From: Oumaima741 Date: Wed, 21 Jan 2026 08:43:24 +0100 Subject: [PATCH 26/40] qst2 --- .github/workflows/ci-pr.yml | 55 +++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/ci-pr.yml diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml new file mode 100644 index 00000000..837d3910 --- /dev/null +++ b/.github/workflows/ci-pr.yml @@ -0,0 +1,55 @@ +name: CI (Pull Request) + +on: + pull_request: + types: [opened] # seulement quand la PR est créée + branches: [main] # branche cible + +permissions: + contents: read + +jobs: + frontend: + name: Frontend - build & lint + runs-on: ubuntu-latest + defaults: + run: + working-directory: frontend + steps: + - uses: actions/checkout@v4 + + - name: Setup Node + - uses: actions/setup-node@v4 + with: + node-version: "20" + cache: "npm" + cache-dependency-path: frontend/package-lock.json + + - name: Install + run: npm ci + + - name: Build + run: npm run build + + - name: Lint + run: npm run lint + + backend: + name: Backend - build (Release) + runs-on: ubuntu-latest + defaults: + run: + working-directory: backend + steps: + - uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v5 + with: + dotnet-version: "9.0.x" + + - name: Restore + run: dotnet restore + + - name: Build (Release) + run: dotnet build -c Release --no-restore From d82ac1e9fc09d9670a836c216612b0733bb5a6d5 Mon Sep 17 00:00:00 2001 From: Oumaima741 Date: Wed, 21 Jan 2026 08:56:06 +0100 Subject: [PATCH 27/40] modiftestcI --- backend/ParkNDeploy.Api/ParkNDeploy.Api.csproj | 2 +- backend/ParkNDeploy.Api/appsettings.Development.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/ParkNDeploy.Api/ParkNDeploy.Api.csproj b/backend/ParkNDeploy.Api/ParkNDeploy.Api.csproj index 7539cfef..a496550e 100644 --- a/backend/ParkNDeploy.Api/ParkNDeploy.Api.csproj +++ b/backend/ParkNDeploy.Api/ParkNDeploy.Api.csproj @@ -5,7 +5,7 @@ enable enable - +\\coucou modif diff --git a/backend/ParkNDeploy.Api/appsettings.Development.json b/backend/ParkNDeploy.Api/appsettings.Development.json index 0c208ae9..f0a9a14a 100644 --- a/backend/ParkNDeploy.Api/appsettings.Development.json +++ b/backend/ParkNDeploy.Api/appsettings.Development.json @@ -3,6 +3,7 @@ "LogLevel": { "Default": "Information", "Microsoft.AspNetCore": "Warning" + } } } From f11269ae92e5f910454f58adb8af3e52ba41e6e9 Mon Sep 17 00:00:00 2001 From: Oumaima741 Date: Wed, 21 Jan 2026 08:56:17 +0100 Subject: [PATCH 28/40] committestc2 --- frontend/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/index.html b/frontend/index.html index 0a5274f1..571cb64d 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -5,7 +5,7 @@ ParkNDeploy - + \\coucou modif
From 8256890eedb35aca73f2dd4e7eadb5f3e7059f15 Mon Sep 17 00:00:00 2001 From: Oumaima741 Date: Wed, 21 Jan 2026 09:00:50 +0100 Subject: [PATCH 29/40] COMMITDOC --- .github/workflows/ci-pr.yml | 55 ++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 29 deletions(-) diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml index 837d3910..c6cad3a2 100644 --- a/.github/workflows/ci-pr.yml +++ b/.github/workflows/ci-pr.yml @@ -1,55 +1,52 @@ -name: CI (Pull Request) +name: CI on Pull Request on: pull_request: - types: [opened] # seulement quand la PR est créée - branches: [main] # branche cible - -permissions: - contents: read + branches: + - main + types: [opened, synchronize, reopened] jobs: frontend: - name: Frontend - build & lint runs-on: ubuntu-latest - defaults: - run: - working-directory: frontend + steps: - - uses: actions/checkout@v4 + - name: Checkout code + uses: actions/checkout@v4 - - name: Setup Node - - uses: actions/setup-node@v4 + - name: Setup Node.js + uses: actions/setup-node@v4 with: - node-version: "20" - cache: "npm" - cache-dependency-path: frontend/package-lock.json + node-version: '20' - - name: Install + - name: Install dependencies run: npm ci + working-directory: ./frontend - - name: Build + - name: Build React app run: npm run build + working-directory: ./frontend - - name: Lint + - name: Run lint run: npm run lint + working-directory: ./frontend backend: - name: Backend - build (Release) runs-on: ubuntu-latest - defaults: - run: - working-directory: backend + steps: - - uses: actions/checkout@v4 + - name: Checkout code + uses: actions/checkout@v4 - - name: Setup .NET - uses: actions/setup-dotnet@v5 + - name: Setup .NET SDK + uses: actions/setup-dotnet@v4 with: - dotnet-version: "9.0.x" + dotnet-version: '9.0.x' - - name: Restore + - name: Restore dependencies run: dotnet restore + working-directory: ./backend - - name: Build (Release) + - name: Build backend in Release run: dotnet build -c Release --no-restore + working-directory: ./backend \ No newline at end of file From 1285a93247e80d80b6c2f2e9ef49a91a881572a2 Mon Sep 17 00:00:00 2001 From: Oumaima741 Date: Wed, 21 Jan 2026 09:04:59 +0100 Subject: [PATCH 30/40] COMMITEXO2 --- .github/workflows/ci-pr.yml | 57 ++++++++++++++++++------------------- frontend/index.html | 2 +- 2 files changed, 29 insertions(+), 30 deletions(-) diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml index 837d3910..a4a9cab6 100644 --- a/.github/workflows/ci-pr.yml +++ b/.github/workflows/ci-pr.yml @@ -1,55 +1,54 @@ -name: CI (Pull Request) + +name: CI on Pull Request on: pull_request: - types: [opened] # seulement quand la PR est créée - branches: [main] # branche cible - -permissions: - contents: read + branches: + - main + types: [opened, synchronize, reopened] jobs: frontend: - name: Frontend - build & lint runs-on: ubuntu-latest - defaults: - run: - working-directory: frontend + steps: - - uses: actions/checkout@v4 + - name: Checkout code + uses: actions/checkout@v4 - - name: Setup Node - - uses: actions/setup-node@v4 + - name: Setup Node.js + uses: actions/setup-node@v4 with: - node-version: "20" - cache: "npm" - cache-dependency-path: frontend/package-lock.json + node-version: '20' - - name: Install + - name: Install dependencies run: npm ci + working-directory: ./frontend - - name: Build + - name: Build React app run: npm run build + working-directory: ./frontend - - name: Lint + - name: Run lint run: npm run lint + working-directory: ./frontend backend: - name: Backend - build (Release) runs-on: ubuntu-latest - defaults: - run: - working-directory: backend + steps: - - uses: actions/checkout@v4 + - name: Checkout code + uses: actions/checkout@v4 - - name: Setup .NET - uses: actions/setup-dotnet@v5 + - name: Setup .NET SDK + uses: actions/setup-dotnet@v4 with: - dotnet-version: "9.0.x" + dotnet-version: '9.0.x' - - name: Restore + - name: Restore dependencies run: dotnet restore + working-directory: ./backend - - name: Build (Release) + - name: Build backend in Release run: dotnet build -c Release --no-restore + working-directory: ./backend + diff --git a/frontend/index.html b/frontend/index.html index 571cb64d..f159ba7d 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -5,7 +5,7 @@ ParkNDeploy - \\coucou modif + \\coucou modifSDQSDCS
From 29b2a3a8072adf591d0bcf8ab64fe61956839042 Mon Sep 17 00:00:00 2001 From: Oumaima741 Date: Wed, 21 Jan 2026 09:09:26 +0100 Subject: [PATCH 31/40] COMMITQST --- backend/ParkNDeploy.Api/ParkNDeploy.Api.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/ParkNDeploy.Api/ParkNDeploy.Api.csproj b/backend/ParkNDeploy.Api/ParkNDeploy.Api.csproj index a496550e..7539cfef 100644 --- a/backend/ParkNDeploy.Api/ParkNDeploy.Api.csproj +++ b/backend/ParkNDeploy.Api/ParkNDeploy.Api.csproj @@ -5,7 +5,7 @@ enable enable -\\coucou modif + From abd4ae0a9daf1b464eab6ed2c48d96aa1089f6c2 Mon Sep 17 00:00:00 2001 From: Oumaima741 Date: Wed, 21 Jan 2026 09:57:43 +0100 Subject: [PATCH 32/40] commitworkflow --- .github/workflows/ci-release.yml | 57 ++++++++ .github/workflows/deploy-infra-and-apps.yml | 154 +++++++++----------- 2 files changed, 129 insertions(+), 82 deletions(-) create mode 100644 .github/workflows/ci-release.yml diff --git a/.github/workflows/ci-release.yml b/.github/workflows/ci-release.yml new file mode 100644 index 00000000..9f46edff --- /dev/null +++ b/.github/workflows/ci-release.yml @@ -0,0 +1,57 @@ +name: CI Release + +on: + push: + tags: + - "*.*.*" + workflow_dispatch: + +permissions: + contents: read + +jobs: + build_backend_artifact: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup .NET SDK 9.0.x + uses: actions/setup-dotnet@v5 + with: + dotnet-version: "9.0.x" + + - name: Publish the app (Release) + working-directory: ./backend + run: dotnet publish -c Release --property:PublishDir=publish + + - name: Upload backend artifact + uses: actions/upload-artifact@v4 + with: + name: backend-artifact + path: backend/ParkNDeploy.Api/publish + retention-days: 5 + + build_frontend_artifact: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "20" + + - name: Build the app + working-directory: ./frontend + run: | + npm ci + npm run build + + - name: Upload frontend artifact + uses: actions/upload-artifact@v4 + with: + name: frontend-artifact + path: frontend/dist + retention-days: 5 diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index dadff089..814cf8ad 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -1,122 +1,112 @@ +name: Deploy Infra and Apps (CD) + on: - push: - tags: - - '[0-9]+.[0-9]+.[0-9]+' + workflow_run: + workflows: ["CI Release"] + types: [completed] workflow_dispatch: - -env: +env: AZURE_RG_NAME: rg-${{ vars.PROJECT_NAME }}-${{ vars.AZURE_RESOURCE_IDENTIFIER }} - + permissions: id-token: write + contents: read jobs: deploy_infrastructure: - + if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} runs-on: ubuntu-latest environment: production outputs: - appServiceName: ${{ steps.bicep_deploy.outputs.appServiceName }} - staticWebAppName: ${{ steps.bicep_deploy.outputs.staticWebAppName }} - - - + 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 + + - name: Login to Azure + uses: azure/login@v2 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 + 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: Login to Azure + - 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: + if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} + runs-on: ubuntu-latest + needs: deploy_infrastructure + environment: production + + steps: + - name: Download backend artifact + uses: actions/download-artifact@v4 + with: + run-id: ${{ github.event.workflow_run.id }} + name: backend-artifact + path: artifacts/backend + + - 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 + + - name: Deploy backend to App Service (from artifact) 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 ... + with: + app-name: ${{ needs.deploy_infrastructure.outputs.appServiceName }} + package: artifacts/backend deploy_frontend: - runs-on: ubuntu-latest - needs: deploy_infrastructure - environment: production - - steps: - - name: Checkout repository - uses: actions/checkout@v4 + if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} + runs-on: ubuntu-latest + needs: deploy_infrastructure + environment: production - - name: Build the app - run: npm install && npm run build - working-directory: ./frontend + steps: + - name: Download frontend artifact + uses: actions/download-artifact@v4 + with: + run-id: ${{ github.event.workflow_run.id }} + name: frontend-artifact + path: artifacts/frontend - - name: Login to Azure + - 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 - # ... + 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 + 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 + - name: Deploy frontend to Static Web App (from artifact) uses: azure/static-web-apps-deploy@v1 with: azure_static_web_apps_api_token: ${{ env.SWA_DEPLOYMENT_TOKEN }} - app_location: frontend/dist + app_location: artifacts/frontend action: upload skip_app_build: true - skip_api_build: true \ No newline at end of file + skip_api_build: true From c7a86caaca227c3a00509a80b1307c00cf4da6d1 Mon Sep 17 00:00:00 2001 From: Oumaima741 Date: Wed, 21 Jan 2026 10:22:17 +0100 Subject: [PATCH 33/40] commitci --- .github/workflows/deploy-infra-and-apps.yml | 150 +++++++++++--------- 1 file changed, 81 insertions(+), 69 deletions(-) diff --git a/.github/workflows/deploy-infra-and-apps.yml b/.github/workflows/deploy-infra-and-apps.yml index 814cf8ad..95bdabb3 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -1,112 +1,124 @@ -name: Deploy Infra and Apps (CD) - on: workflow_run: workflows: ["CI Release"] types: [completed] workflow_dispatch: -env: - AZURE_RG_NAME: rg-${{ vars.PROJECT_NAME }}-${{ vars.AZURE_RESOURCE_IDENTIFIER }} + +env: + AZURE_RG_NAME: rg-${{ vars.PROJECT_NAME }}-${{ vars.AZURE_RESOURCE_IDENTIFIER }} + permissions: id-token: write - contents: read jobs: deploy_infrastructure: - if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} + runs-on: ubuntu-latest environment: production outputs: - appServiceName: ${{ steps.bicep_deploy.outputs.appServiceName }} - staticWebAppName: ${{ steps.bicep_deploy.outputs.staticWebAppName }} - - steps: - - name: Checkout repository - uses: actions/checkout@v4 + appServiceName: ${{ steps.bicep_deploy.outputs.appServiceName }} + staticWebAppName: ${{ steps.bicep_deploy.outputs.staticWebAppName }} + + - - 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 }} + 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: - if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} - runs-on: ubuntu-latest - needs: deploy_infrastructure - environment: production - - steps: - - name: Download backend artifact - uses: actions/download-artifact@v4 + 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: - run-id: ${{ github.event.workflow_run.id }} - name: backend-artifact - path: artifacts/backend + 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 + - 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 (from artifact) + + - name: Deploy backend to App Service uses: azure/webapps-deploy@v2 - with: - app-name: ${{ needs.deploy_infrastructure.outputs.appServiceName }} - package: artifacts/backend + 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_infrastructure ... deploy_frontend: - if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} - runs-on: ubuntu-latest - needs: deploy_infrastructure - environment: production + runs-on: ubuntu-latest + needs: deploy_infrastructure + environment: production - steps: - - name: Download frontend artifact - uses: actions/download-artifact@v4 - with: - run-id: ${{ github.event.workflow_run.id }} - name: frontend-artifact - path: artifacts/frontend + steps: + - name: Checkout repository + uses: actions/checkout@v4 - - name: Login to Azure + - 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 }} + 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 + 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 (from artifact) + # 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: artifacts/frontend + app_location: frontend/dist action: upload skip_app_build: true - skip_api_build: true + skip_api_build: true \ No newline at end of file From 17eb55016e750fe4bcb2984e0db7cdbe0ce91d0d Mon Sep 17 00:00:00 2001 From: Oumaima741 Date: Wed, 21 Jan 2026 11:15:09 +0100 Subject: [PATCH 34/40] commitcicd --- .github/workflows/ci-release.yml | 163 ++++++++++++++++---- .github/workflows/deploy-infra-and-apps.yml | 28 ++-- 2 files changed, 145 insertions(+), 46 deletions(-) diff --git a/.github/workflows/ci-release.yml b/.github/workflows/ci-release.yml index 9f46edff..3d01ea3d 100644 --- a/.github/workflows/ci-release.yml +++ b/.github/workflows/ci-release.yml @@ -1,57 +1,164 @@ -name: CI Release +name: CI/CD Release on: push: - tags: - - "*.*.*" - workflow_dispatch: + branches: + - main + +env: + AZURE_RG_NAME: rg-${{ vars.PROJECT_NAME }}-${{ vars.AZURE_RESOURCE_IDENTIFIER }} permissions: - contents: read + id-token: write jobs: - build_backend_artifact: + + frontend: + name: Build Frontend + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '18' + + - name: Install dependencies + run: npm ci + working-directory: ./frontend + + - name: Build React app + run: npm run build + working-directory: ./frontend + + - name: Upload frontend artifact + uses: actions/upload-artifact@v4 + with: + name: frontend-build + path: ./frontend/dist + + backend: + name: Build Backend runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 - - name: Setup .NET SDK 9.0.x - uses: actions/setup-dotnet@v5 + - name: Setup .NET SDK + uses: actions/setup-dotnet@v4 with: - dotnet-version: "9.0.x" + dotnet-version: '9.0.x' - - name: Publish the app (Release) - working-directory: ./backend - run: dotnet publish -c Release --property:PublishDir=publish + - name: Restore dependencies + run: dotnet restore + working-directory: ./backend/ParkNDeploy.Api + + - name: Publish .NET app + run: dotnet publish -c Release -o ./publish + working-directory: ./backend/ParkNDeploy.Api - name: Upload backend artifact uses: actions/upload-artifact@v4 with: - name: backend-artifact - path: backend/ParkNDeploy.Api/publish - retention-days: 5 + name: backend-publish + path: ./backend/ParkNDeploy.Api/publish + - build_frontend_artifact: + deploy_infrastructure: runs-on: ubuntu-latest + needs: [frontend, backend] + environment: production + outputs: + appServiceName: ${{ steps.bicep_deploy.outputs.appServiceName }} + staticWebAppName: ${{ steps.bicep_deploy.outputs.staticWebAppName }} steps: - name: Checkout repository uses: actions/checkout@v4 - - name: Setup Node.js - uses: actions/setup-node@v4 + - name: Login to Azure + uses: azure/login@v2 with: - node-version: "20" + client-id: ${{ secrets.AZURE_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + enable-AzPSSession: true - - name: Build the app - working-directory: ./frontend + - name: Create resource group if not exists run: | - npm ci - npm run build + az group show --name ${{ env.AZURE_RG_NAME }} || + az group create --name ${{ env.AZURE_RG_NAME }} --location ${{ secrets.AZURE_REGION }} - - name: Upload frontend artifact - uses: actions/upload-artifact@v4 + - 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: Download backend artifact + uses: actions/download-artifact@v4 + with: + name: backend-publish + path: ./backend_publish + + - 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 }} + package: ./backend_publish + + + deploy_frontend: + runs-on: ubuntu-latest + needs: deploy_infrastructure + environment: production + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Download frontend artifact + uses: actions/download-artifact@v4 + with: + name: frontend-build + path: ./frontend_dist + + - 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: 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: - name: frontend-artifact - path: frontend/dist - retention-days: 5 + azure_static_web_apps_api_token: ${{ env.SWA_DEPLOYMENT_TOKEN }} + app_location: frontend_dist + action: upload + skip_app_build: true + skip_api_build: true \ 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 95bdabb3..dfb8cac6 100644 --- a/.github/workflows/deploy-infra-and-apps.yml +++ b/.github/workflows/deploy-infra-and-apps.yml @@ -1,11 +1,11 @@ + on: - workflow_run: - workflows: ["CI Release"] - types: [completed] + push: + tags: + - '[0-9]+.[0-9]+.[0-9]+' workflow_dispatch: - env: AZURE_RG_NAME: rg-${{ vars.PROJECT_NAME }}-${{ vars.AZURE_RESOURCE_IDENTIFIER }} @@ -14,15 +14,11 @@ permissions: jobs: deploy_infrastructure: - runs-on: ubuntu-latest environment: production outputs: appServiceName: ${{ steps.bicep_deploy.outputs.appServiceName }} staticWebAppName: ${{ steps.bicep_deploy.outputs.staticWebAppName }} - - - steps: - name: Checkout repository @@ -66,7 +62,7 @@ jobs: 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 + run: dotnet publish -c Release --propertyublishDir=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 @@ -82,7 +78,6 @@ jobs: 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_infrastructure ... deploy_frontend: runs-on: ubuntu-latest @@ -103,17 +98,12 @@ 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 + 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: @@ -121,4 +111,6 @@ 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 79d71f637cd3b756005064448387d42d673a75cf Mon Sep 17 00:00:00 2001 From: Oumaima741 Date: Wed, 21 Jan 2026 11:47:00 +0100 Subject: [PATCH 35/40] changement manuel --- frontend/package-lock.json | 4 ++-- frontend/package.json | 2 +- frontend/src/App.tsx | 2 ++ frontend/vite.config.ts | 3 +++ 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index f4a4f550..569a872e 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1,12 +1,12 @@ { "name": "frontend", - "version": "0.0.0", + "version": "1.2.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "frontend", - "version": "0.0.0", + "version": "1.2.3", "dependencies": { "@radix-ui/react-icons": "^1.3.2", "@tanstack/react-query": "^5.84.1", diff --git a/frontend/package.json b/frontend/package.json index a0946957..7d8557ea 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,7 +1,7 @@ { "name": "frontend", "private": true, - "version": "0.0.0", + "version": "1.2.3", "type": "module", "scripts": { "dev": "vite --port 5175", diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 986ff9bb..0cb47eb4 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -23,6 +23,8 @@ function App() {

Where can I Park in Angers ? 👀

+

ParkNDeploy

+

Version: {APP_VERSION}

{ console.log(parkingName); diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index ed788acb..b1a66785 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -20,4 +20,7 @@ export default defineConfig({ }, }, plugins: [react()], + define: { + APP_VERSION: JSON.stringify(process.env.npm_package_version), + }, }) From 15d45bf64eff688f716041861c79a4ca8ed93c4e Mon Sep 17 00:00:00 2001 From: Oumaima741 Date: Wed, 21 Jan 2026 11:49:04 +0100 Subject: [PATCH 36/40] alanceravectag --- .github/workflows/ci-release.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci-release.yml b/.github/workflows/ci-release.yml index 3d01ea3d..43421c8c 100644 --- a/.github/workflows/ci-release.yml +++ b/.github/workflows/ci-release.yml @@ -4,6 +4,9 @@ on: push: branches: - main + tags: + - '[0-9]+.[0-9]+.[0-9]+' + env: AZURE_RG_NAME: rg-${{ vars.PROJECT_NAME }}-${{ vars.AZURE_RESOURCE_IDENTIFIER }} From b854ace62483c79de9209252dc8105f1b3b68711 Mon Sep 17 00:00:00 2001 From: Oumaima741 Date: Wed, 21 Jan 2026 11:53:19 +0100 Subject: [PATCH 37/40] changement manuel --- .github/workflows/ci-release.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/ci-release.yml b/.github/workflows/ci-release.yml index 43421c8c..62ae87e0 100644 --- a/.github/workflows/ci-release.yml +++ b/.github/workflows/ci-release.yml @@ -1,11 +1,6 @@ name: CI/CD Release -on: - push: - branches: - - main - tags: - - '[0-9]+.[0-9]+.[0-9]+' + env: From 87c7369fa240eb5347b57be6d42aade8e43f2b5c Mon Sep 17 00:00:00 2001 From: Oumaima741 Date: Wed, 21 Jan 2026 11:55:18 +0100 Subject: [PATCH 38/40] committag --- .github/workflows/ci-release.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-release.yml b/.github/workflows/ci-release.yml index 62ae87e0..f0e8bc25 100644 --- a/.github/workflows/ci-release.yml +++ b/.github/workflows/ci-release.yml @@ -1,6 +1,9 @@ name: CI/CD Release - +on: + push: + tags: + - '[0-9]+.[0-9]+.[0-9]+' env: From daae81b3d9941fe7e1721acea8900210331dd9b8 Mon Sep 17 00:00:00 2001 From: Oumaima741 Date: Wed, 21 Jan 2026 12:05:09 +0100 Subject: [PATCH 39/40] manuel --- .github/workflows/ci-release.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-release.yml b/.github/workflows/ci-release.yml index f0e8bc25..3d01ea3d 100644 --- a/.github/workflows/ci-release.yml +++ b/.github/workflows/ci-release.yml @@ -2,9 +2,8 @@ name: CI/CD Release on: push: - tags: - - '[0-9]+.[0-9]+.[0-9]+' - + branches: + - main env: AZURE_RG_NAME: rg-${{ vars.PROJECT_NAME }}-${{ vars.AZURE_RESOURCE_IDENTIFIER }} From 8fd424f6be911b0f975093fdc4e63294900a5d68 Mon Sep 17 00:00:00 2001 From: Oumaima741 Date: Wed, 21 Jan 2026 12:16:01 +0100 Subject: [PATCH 40/40] done --- frontend/src/vite-env.d.ts | 2 ++ frontend/vite.config.ts | 34 +++++++++++++++------------------- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/frontend/src/vite-env.d.ts b/frontend/src/vite-env.d.ts index 11f02fe2..354c5b3b 100644 --- a/frontend/src/vite-env.d.ts +++ b/frontend/src/vite-env.d.ts @@ -1 +1,3 @@ /// + +declare const APP_VERSION: string; \ No newline at end of file diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index b1a66785..754cd9fc 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -1,26 +1,22 @@ -import { defineConfig } from 'vite' -import react from '@vitejs/plugin-react' -import path from 'path' +import { defineConfig } from "vite"; +import react from "@vitejs/plugin-react"; +import path from "path"; +import pkg from "./package.json"; -// https://vitejs.dev/config/ export default defineConfig({ - server:{ - proxy: - { - // redirect request on /api to target specified - '/api': { - target: 'https://localhost:7085/', // whether you're running your local api with kestrel or behind IIS Express, the port mind change - secure: false, // Do not verify SSL certificates + server: { + proxy: { + "/api": { + target: "https://localhost:7085/", + secure: false, }, - } - }, - resolve: { - alias: { - '@': path.resolve(__dirname, 'src'), }, - }, + }, + resolve: { + alias: { "@": path.resolve(__dirname, "src") }, + }, plugins: [react()], define: { - APP_VERSION: JSON.stringify(process.env.npm_package_version), + APP_VERSION: JSON.stringify(process.env.VITE_APP_VERSION ?? pkg.version), }, -}) +});