From 73267a3fd3afc18bd270dbe4ff14e3ac132bab63 Mon Sep 17 00:00:00 2001 From: jay20240510 <929793296@qq.com> Date: Wed, 27 Nov 2024 13:35:43 +0800 Subject: [PATCH 1/5] ci: add Azure Static Web Apps workflow file on-behalf-of: @Azure opensource@microsoft.com --- ...re-static-web-apps-gray-bush-099f22f10.yml | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/azure-static-web-apps-gray-bush-099f22f10.yml diff --git a/.github/workflows/azure-static-web-apps-gray-bush-099f22f10.yml b/.github/workflows/azure-static-web-apps-gray-bush-099f22f10.yml new file mode 100644 index 0000000..24170f2 --- /dev/null +++ b/.github/workflows/azure-static-web-apps-gray-bush-099f22f10.yml @@ -0,0 +1,46 @@ +name: Azure Static Web Apps CI/CD + +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened, closed] + branches: + - main + +jobs: + build_and_deploy_job: + if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') + runs-on: ubuntu-latest + name: Build and Deploy Job + steps: + - uses: actions/checkout@v3 + with: + submodules: true + lfs: false + - name: Build And Deploy + id: builddeploy + uses: Azure/static-web-apps-deploy@v1 + with: + azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_GRAY_BUSH_099F22F10 }} + repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments) + action: "upload" + ###### Repository/Build Configurations - These values can be configured to match your app requirements. ###### + # For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig + app_location: "./client" # App source code path + api_location: "" # Api source code path - optional + output_location: "build" # Built app content directory - optional + ###### End of Repository/Build Configurations ###### + + close_pull_request_job: + if: github.event_name == 'pull_request' && github.event.action == 'closed' + runs-on: ubuntu-latest + name: Close Pull Request Job + steps: + - name: Close Pull Request + id: closepullrequest + uses: Azure/static-web-apps-deploy@v1 + with: + azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_GRAY_BUSH_099F22F10 }} + action: "close" From c5f7eb2a7db9c887d764c86f6de07e3d7d31df88 Mon Sep 17 00:00:00 2001 From: jay20240510 <929793296@qq.com> Date: Wed, 27 Nov 2024 14:37:49 +0800 Subject: [PATCH 2/5] Create backup.yml --- .github/workflows/main.yml | 46 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..d51dac4 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,46 @@ +name: Azure Static Web Apps CI/CD + +on: + push: + branches: + - backup + pull_request: + types: [opened, synchronize, reopened, closed] + branches: + - backup + +jobs: + build_and_deploy_job: + if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') + runs-on: ubuntu-latest + name: Build and Deploy Job + steps: + - uses: actions/checkout@v3 + with: + submodules: true + lfs: false + - name: Build And Deploy + id: builddeploy + uses: Azure/static-web-apps-deploy@v1 + with: + azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_GRAY_BUSH_099F22F10 }} + repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments) + action: "upload" + ###### Repository/Build Configurations - These values can be configured to match your app requirements. ###### + # For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig + app_location: "./client" # App source code path + api_location: "" # Api source code path - optional + output_location: "build" # Built app content directory - optional + ###### End of Repository/Build Configurations ###### + + close_pull_request_job: + if: github.event_name == 'pull_request' && github.event.action == 'closed' + runs-on: ubuntu-latest + name: Close Pull Request Job + steps: + - name: Close Pull Request + id: closepullrequest + uses: Azure/static-web-apps-deploy@v1 + with: + azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_GRAY_BUSH_099F22F10 }} + action: "close" From 48243649a8cdf27b833f2fb0ad251e6b9cf75323 Mon Sep 17 00:00:00 2001 From: jay20240510 <929793296@qq.com> Date: Wed, 27 Nov 2024 15:40:33 +0800 Subject: [PATCH 3/5] Update azure-static-web-apps-gray-bush-099f22f10.yml --- .../workflows/azure-static-web-apps-gray-bush-099f22f10.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/azure-static-web-apps-gray-bush-099f22f10.yml b/.github/workflows/azure-static-web-apps-gray-bush-099f22f10.yml index 24170f2..9cb7372 100644 --- a/.github/workflows/azure-static-web-apps-gray-bush-099f22f10.yml +++ b/.github/workflows/azure-static-web-apps-gray-bush-099f22f10.yml @@ -3,11 +3,11 @@ name: Azure Static Web Apps CI/CD on: push: branches: - - main + - backup pull_request: types: [opened, synchronize, reopened, closed] branches: - - main + - backup jobs: build_and_deploy_job: From b63032e5f75ea0deb193497e54dddcc17947f196 Mon Sep 17 00:00:00 2001 From: jay20240510 <929793296@qq.com> Date: Thu, 28 Nov 2024 10:13:08 +0800 Subject: [PATCH 4/5] Update azure-static-web-apps-gray-bush-099f22f10.yml --- .../workflows/azure-static-web-apps-gray-bush-099f22f10.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/azure-static-web-apps-gray-bush-099f22f10.yml b/.github/workflows/azure-static-web-apps-gray-bush-099f22f10.yml index 9cb7372..24170f2 100644 --- a/.github/workflows/azure-static-web-apps-gray-bush-099f22f10.yml +++ b/.github/workflows/azure-static-web-apps-gray-bush-099f22f10.yml @@ -3,11 +3,11 @@ name: Azure Static Web Apps CI/CD on: push: branches: - - backup + - main pull_request: types: [opened, synchronize, reopened, closed] branches: - - backup + - main jobs: build_and_deploy_job: From 8b3dd0c0a7f8e8f786534dfaa7640c139d38d595 Mon Sep 17 00:00:00 2001 From: jay20240510 <929793296@qq.com> Date: Fri, 29 Nov 2024 12:28:30 +0800 Subject: [PATCH 5/5] Update config.json --- config.json | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/config.json b/config.json index 39407af..b6de0e9 100644 --- a/config.json +++ b/config.json @@ -24,4 +24,29 @@ "resourceType": "postgres" } ] + { + "routes": [ + { + "route": "/", + "allowedRoles": [ "authenticated" ] + } + ], + "responseOverrides": { + "401": { + "redirect": "/.auth/login/aad", + "statusCode": 302 + } + }, + "auth": { + "identityProviders": { + "azureActiveDirectory": { + "registration": { + "openIdIssuer": " https://login.microsoftonline.com/SUBSTITUTE_THIS_WITH_TENANT_INFO_ID", + "clientIdSettingName": "AZURE_CLIENT_ID", + "clientSecretSettingName": "AZURE_CLIENT_SECRET" + },"userDetailsClaim": " http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name" + } + } + } +} }