From 71fba95456404761d9d36e0d5bec846f1c3dcd83 Mon Sep 17 00:00:00 2001 From: Wayne Ferrao Date: Tue, 23 Jul 2024 15:19:46 -0700 Subject: [PATCH 01/33] ci: add Azure Static Web Apps workflow file on-behalf-of: @Azure opensource@microsoft.com --- ...static-web-apps-happy-pebble-0ab98d51e.yml | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml diff --git a/.github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml b/.github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml new file mode 100644 index 000000000000..210d4cd984a4 --- /dev/null +++ b/.github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.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_HAPPY_PEBBLE_0AB98D51E }} + 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: "/" # App source code path + api_location: "" # Api source code path - optional + output_location: "" # 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_HAPPY_PEBBLE_0AB98D51E }} + action: "close" From 208db5fabffa56c342b49ebd9b9c5a70fffdc460 Mon Sep 17 00:00:00 2001 From: Wayne Ferrao Date: Tue, 23 Jul 2024 16:13:10 -0700 Subject: [PATCH 02/33] Update azure-static-web-apps-happy-pebble-0ab98d51e.yml --- .../workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml b/.github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml index 210d4cd984a4..f55e5937d69c 100644 --- a/.github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml +++ b/.github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml @@ -28,7 +28,7 @@ jobs: 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: "/" # App source code path + app_location: "packages/tools/devtools/devtools-example" # App source code path api_location: "" # Api source code path - optional output_location: "" # Built app content directory - optional ###### End of Repository/Build Configurations ###### From 917f3aefcb94d1cd18dd1d2d01b6ca8f7cbd72ca Mon Sep 17 00:00:00 2001 From: Wayne Ferrao Date: Tue, 23 Jul 2024 16:18:12 -0700 Subject: [PATCH 03/33] Updated pipeline to install pnpm to fix workspace error --- .../azure-static-web-apps-happy-pebble-0ab98d51e.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml b/.github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml index f55e5937d69c..011f48354bd6 100644 --- a/.github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml +++ b/.github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml @@ -19,6 +19,18 @@ jobs: with: submodules: true lfs: false + # Step to install pnpm + - name: Install pnpm + run: npx pnpm@8 install + + # Install dependencies using pnpm + - name: Install dependencies + run: pnpm install + + # Build the project using pnpm + - name: Build the project + run: pnpm run build + - name: Build And Deploy id: builddeploy uses: Azure/static-web-apps-deploy@v1 From a6c7a6a9bfe9a01f66ad6d53398a202bbb6f8a2f Mon Sep 17 00:00:00 2001 From: Wayne Ferrao Date: Tue, 23 Jul 2024 16:26:00 -0700 Subject: [PATCH 04/33] fix pnpm install --- .../workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml b/.github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml index 011f48354bd6..21138a142981 100644 --- a/.github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml +++ b/.github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml @@ -21,7 +21,7 @@ jobs: lfs: false # Step to install pnpm - name: Install pnpm - run: npx pnpm@8 install + run: npm install -g pnpm@8 # Install dependencies using pnpm - name: Install dependencies From bcebef7dd16c93979e6eab380c723cc97174b610 Mon Sep 17 00:00:00 2001 From: Wayne Ferrao Date: Tue, 23 Jul 2024 17:33:53 -0700 Subject: [PATCH 05/33] Update build timeout --- .../workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml b/.github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml index 21138a142981..f6069a1eab98 100644 --- a/.github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml +++ b/.github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml @@ -42,6 +42,7 @@ jobs: # For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig app_location: "packages/tools/devtools/devtools-example" # App source code path api_location: "" # Api source code path - optional + build_timeout_in_minutes: 90 output_location: "" # Built app content directory - optional ###### End of Repository/Build Configurations ###### From 427504c5e155205bcfe07b611089c40d1b60f225 Mon Sep 17 00:00:00 2001 From: Wayne Ferrao Date: Thu, 25 Jul 2024 11:04:56 -0700 Subject: [PATCH 06/33] update build output --- .../workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml b/.github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml index f6069a1eab98..2f348a6f001f 100644 --- a/.github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml +++ b/.github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml @@ -43,7 +43,7 @@ jobs: app_location: "packages/tools/devtools/devtools-example" # App source code path api_location: "" # Api source code path - optional build_timeout_in_minutes: 90 - output_location: "" # Built app content directory - optional + output_location: "lib" # Built app content directory - optional ###### End of Repository/Build Configurations ###### close_pull_request_job: From c590b411eb04bdc59f54a55bd734f634d7527805 Mon Sep 17 00:00:00 2001 From: Wayne Ferrao Date: Thu, 25 Jul 2024 12:58:06 -0700 Subject: [PATCH 07/33] update build output --- .../workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml b/.github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml index 2f348a6f001f..bbfab4af026a 100644 --- a/.github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml +++ b/.github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml @@ -43,7 +43,7 @@ jobs: app_location: "packages/tools/devtools/devtools-example" # App source code path api_location: "" # Api source code path - optional build_timeout_in_minutes: 90 - output_location: "lib" # Built app content directory - optional + output_location: "packages/tools/devtools/devtools-example/lib" # Built app content directory - optional ###### End of Repository/Build Configurations ###### close_pull_request_job: From 1e026f37b37cd545ad5cd20788bf1b19be183837 Mon Sep 17 00:00:00 2001 From: Wayne Ferrao Date: Thu, 25 Jul 2024 14:25:22 -0700 Subject: [PATCH 08/33] update build --- .../workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml b/.github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml index bbfab4af026a..3797653cad88 100644 --- a/.github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml +++ b/.github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml @@ -25,7 +25,7 @@ jobs: # Install dependencies using pnpm - name: Install dependencies - run: pnpm install + run: cd packages/tools/devtools/devtools-example && pnpm install # Build the project using pnpm - name: Build the project From e4d24e13ce9e1fada6dc4a4e5b46de600ad18301 Mon Sep 17 00:00:00 2001 From: Wayne Ferrao Date: Thu, 25 Jul 2024 14:31:57 -0700 Subject: [PATCH 09/33] update working directory --- .../azure-static-web-apps-happy-pebble-0ab98d51e.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml b/.github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml index 3797653cad88..472fb8aec925 100644 --- a/.github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml +++ b/.github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml @@ -25,10 +25,12 @@ jobs: # Install dependencies using pnpm - name: Install dependencies - run: cd packages/tools/devtools/devtools-example && pnpm install + working-directory: packages/tools/devtools/devtools-example + run: pnpm install # Build the project using pnpm - name: Build the project + working-directory: packages/tools/devtools/devtools-example run: pnpm run build - name: Build And Deploy From 669659be772ea5afaaf384135253a49b95f94774 Mon Sep 17 00:00:00 2001 From: Wayne Ferrao Date: Thu, 25 Jul 2024 15:00:34 -0700 Subject: [PATCH 10/33] add oryx env variables --- .../azure-static-web-apps-happy-pebble-0ab98d51e.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml b/.github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml index 472fb8aec925..91517d9d73eb 100644 --- a/.github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml +++ b/.github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml @@ -32,6 +32,13 @@ jobs: - name: Build the project working-directory: packages/tools/devtools/devtools-example run: pnpm run build + # Set up environment variables for Oryx + - name: Set up environment variables for Oryx + run: | + echo 'export ENABLE_DYNAMIC_INSTALL=true' >> $GITHUB_ENV + echo 'export ENABLE_NODE_MONOREPO=true' >> $GITHUB_ENV + echo 'export NODE_VERSION=16' >> $GITHUB_ENV + echo 'LOG_LEVEL=debug' >> $GITHUB_ENV - name: Build And Deploy id: builddeploy From efc1f94a12843138a7880e6f5f73d458bf0d03ed Mon Sep 17 00:00:00 2001 From: Wayne Ferrao Date: Thu, 25 Jul 2024 16:21:46 -0700 Subject: [PATCH 11/33] Skip app build --- .../azure-static-web-apps-happy-pebble-0ab98d51e.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml b/.github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml index 91517d9d73eb..1bdf5d7c38f5 100644 --- a/.github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml +++ b/.github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml @@ -52,7 +52,9 @@ jobs: app_location: "packages/tools/devtools/devtools-example" # App source code path api_location: "" # Api source code path - optional build_timeout_in_minutes: 90 - output_location: "packages/tools/devtools/devtools-example/lib" # Built app content directory - optional + output_location: '' # Built app content directory - optional + skip_app_build: true + skip_api_build: true ###### End of Repository/Build Configurations ###### close_pull_request_job: From 86d24236b4b97c0dfa3bf9a2e4d224f754f570e5 Mon Sep 17 00:00:00 2001 From: Wayne Ferrao Date: Wed, 20 Nov 2024 13:50:09 -0800 Subject: [PATCH 12/33] test change --- docs/api-docs-build-manifest.json | 1 + docs/src/components/home/banner.tsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 docs/api-docs-build-manifest.json diff --git a/docs/api-docs-build-manifest.json b/docs/api-docs-build-manifest.json new file mode 100644 index 000000000000..d5e611a9c99c --- /dev/null +++ b/docs/api-docs-build-manifest.json @@ -0,0 +1 @@ +{"apiDocsVersions":["1","2"]} \ No newline at end of file diff --git a/docs/src/components/home/banner.tsx b/docs/src/components/home/banner.tsx index 9e0869062579..c1751200f223 100644 --- a/docs/src/components/home/banner.tsx +++ b/docs/src/components/home/banner.tsx @@ -29,7 +29,7 @@ const titleBoxDescriptionText = function TitleBox(): React.ReactElement { return (
-

Fluid Framework

+

Fluid Frameworks

{titleBoxDescriptionText}
); From c64499f54d363a3fed2252478b17bb77af2abda9 Mon Sep 17 00:00:00 2001 From: Wayne Ferrao Date: Wed, 20 Nov 2024 14:21:10 -0800 Subject: [PATCH 13/33] ci: add Azure Static Web Apps workflow file on-behalf-of: @Azure opensource@microsoft.com --- ...tatic-web-apps-orange-meadow-01ae28c10.yml | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/azure-static-web-apps-orange-meadow-01ae28c10.yml diff --git a/.github/workflows/azure-static-web-apps-orange-meadow-01ae28c10.yml b/.github/workflows/azure-static-web-apps-orange-meadow-01ae28c10.yml new file mode 100644 index 000000000000..e9a9431cfff2 --- /dev/null +++ b/.github/workflows/azure-static-web-apps-orange-meadow-01ae28c10.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_ORANGE_MEADOW_01AE28C10 }} + 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: "/" # App source code path + api_location: "" # Api source code path - optional + output_location: "" # 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_ORANGE_MEADOW_01AE28C10 }} + action: "close" From e1487d13d36403cf3663a05d864d178363bd5786 Mon Sep 17 00:00:00 2001 From: Wayne Ferrao Date: Wed, 20 Nov 2024 14:33:01 -0800 Subject: [PATCH 14/33] Created Github action for pre production website environment --- .github/workflows/azure-staticwebapp.yml | 66 ++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .github/workflows/azure-staticwebapp.yml diff --git a/.github/workflows/azure-staticwebapp.yml b/.github/workflows/azure-staticwebapp.yml new file mode 100644 index 000000000000..8f302740fadf --- /dev/null +++ b/.github/workflows/azure-staticwebapp.yml @@ -0,0 +1,66 @@ +name: Preproduction Deployment + +on: + pull_request: + types: [opened, synchronize, reopened] + branches: [ "main" ] # Adjust if your default branch is different + +env: + APP_LOCATION: "/" # Location of your client code + API_LOCATION: "api" # Location of your API source code (optional) + APP_ARTIFACT_LOCATION: "build" # Location where the build artifacts are generated + AZURE_STATIC_WEB_APPS_API_TOKEN: ${{ secrets.AZURE_STATIC_WEB_APPS_PREPROD_API_TOKEN }} # Preprod SWA deployment token + +permissions: + contents: read + pull-requests: write # Needed for posting comments on PRs + +jobs: + build_and_deploy: + runs-on: ubuntu-latest + name: Build and Deploy to Preprod SWA + steps: + # Step 1: Checkout the repository + - uses: actions/checkout@v4 + with: + submodules: true + + # Step 2: Set up Node.js (Adjust version as needed) + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '16' # Specify your Node.js version + + # Step 3: Install Dependencies + - name: Install Dependencies + run: | + npm install + npm run build # Modify if your build command is different + + # Step 4: Deploy to Azure Static Web Apps (Preprod) + - name: Deploy to Azure Static Web Apps (Preprod) + id: deploy + uses: Azure/static-web-apps-deploy@v1 + with: + azure_static_web_apps_api_token: ${{ env.AZURE_STATIC_WEB_APPS_API_TOKEN }} + repo_token: ${{ secrets.GITHUB_TOKEN }} # Automatically provided by GitHub + action: "upload" + ###### Repository/Build Configurations - Adjust these values as needed ###### + app_location: ${{ env.APP_LOCATION }} + api_location: ${{ env.API_LOCATION }} + app_artifact_location: ${{ env.APP_ARTIFACT_LOCATION }} + ###### End of Repository/Build Configurations ###### + + # Step 5: Post Deployment Feedback (Optional) + - name: Post Deployment URL as PR Comment + if: success() + uses: actions/github-script@v6 + with: + script: | + const url = '${{ steps.deploy.outputs.preview_url }}'; + github.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: `✅ **Pre-production Deployment Successful** 🚀\n\nYou can view the changes here: ${url}` + }); From 76ce56a9806d61208f0097c6805ac6d2dc62e313 Mon Sep 17 00:00:00 2001 From: Wayne Ferrao Date: Wed, 20 Nov 2024 15:23:14 -0800 Subject: [PATCH 15/33] Add action --- .github/workflows/preproductionDeployment.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .github/workflows/preproductionDeployment.yml diff --git a/.github/workflows/preproductionDeployment.yml b/.github/workflows/preproductionDeployment.yml new file mode 100644 index 000000000000..e69de29bb2d1 From 6917ba6cfe76d3ed2f3b678dad757c758cdef9be Mon Sep 17 00:00:00 2001 From: Wayne Ferrao Date: Wed, 20 Nov 2024 15:25:00 -0800 Subject: [PATCH 16/33] remove unwanted change --- docs/api-docs-build-manifest.json | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/api-docs-build-manifest.json b/docs/api-docs-build-manifest.json index d5e611a9c99c..e69de29bb2d1 100644 --- a/docs/api-docs-build-manifest.json +++ b/docs/api-docs-build-manifest.json @@ -1 +0,0 @@ -{"apiDocsVersions":["1","2"]} \ No newline at end of file From ee22d0d6ef3718b581d56fdfc306cc6606d82e54 Mon Sep 17 00:00:00 2001 From: Wayne Ferrao Date: Wed, 20 Nov 2024 15:25:20 -0800 Subject: [PATCH 17/33] update action --- .github/workflows/preproductionDeployment.yml | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/.github/workflows/preproductionDeployment.yml b/.github/workflows/preproductionDeployment.yml index e69de29bb2d1..88cf219e4333 100644 --- a/.github/workflows/preproductionDeployment.yml +++ b/.github/workflows/preproductionDeployment.yml @@ -0,0 +1,70 @@ +name: Preproduction Deployment + +on: + pull_request: + types: [opened, synchronize, reopened] + branches: [ "main" ] # Adjust if your default branch is different + +env: + APP_LOCATION: "/" # Location of your client code + API_LOCATION: "api" # Location of your API source code (optional) + APP_ARTIFACT_LOCATION: "build" # Location where the build artifacts are generated + AZURE_STATIC_WEB_APPS_API_TOKEN: ${{ secrets.AZURE_STATIC_WEB_APPS_PREPROD_API_TOKEN }} # Preprod SWA deployment token + +permissions: + contents: read + pull-requests: write # Needed for posting comments on PRs + +jobs: + build_and_deploy: + runs-on: ubuntu-latest + name: Build and Deploy to Preprod SWA + steps: + # Step 1: Checkout the repository + - uses: actions/checkout@v4 + with: + submodules: true + + # Step 2: Set up Node.js (Adjust version as needed) + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '18.18' + + - name: Install pnpm + run: npm install -g pnpm + + # Step 3: Install Dependencies + - name: Install Dependencies + run: | + cd docs + pnpm i --frozen-lockfile + pnpm run build + + # Step 4: Deploy to Azure Static Web Apps (Preprod) + - name: Deploy to Azure Static Web Apps (Preprod) + id: deploy + uses: Azure/static-web-apps-deploy@v1 + with: + azure_static_web_apps_api_token: ${{ env.AZURE_STATIC_WEB_APPS_API_TOKEN }} + repo_token: ${{ secrets.GITHUB_TOKEN }} # Automatically provided by GitHub + action: "upload" + ###### Repository/Build Configurations - Adjust these values as needed ###### + app_location: ${{ env.APP_LOCATION }} + api_location: ${{ env.API_LOCATION }} + app_artifact_location: ${{ env.APP_ARTIFACT_LOCATION }} + ###### End of Repository/Build Configurations ###### + + # Step 5: Post Deployment Feedback (Optional) + - name: Post Deployment URL as PR Comment + if: success() + uses: actions/github-script@v6 + with: + script: | + const url = '${{ steps.deploy.outputs.preview_url }}'; + github.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: `✅ **Pre-production Deployment Successful** 🚀\n\nYou can view the changes here: ${url}` + }); From dd4c5d6e25a32f77bdd2f3e4fa0ce97d35e7360e Mon Sep 17 00:00:00 2001 From: Wayne Ferrao Date: Wed, 20 Nov 2024 15:25:55 -0800 Subject: [PATCH 18/33] removed file --- docs/api-docs-build-manifest.json | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 docs/api-docs-build-manifest.json diff --git a/docs/api-docs-build-manifest.json b/docs/api-docs-build-manifest.json deleted file mode 100644 index e69de29bb2d1..000000000000 From dd08e080b39355c527b042d3e379e15834623a4a Mon Sep 17 00:00:00 2001 From: Wayne Ferrao Date: Wed, 20 Nov 2024 15:40:50 -0800 Subject: [PATCH 19/33] updated deployment environment --- .github/workflows/preproductionDeployment.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/preproductionDeployment.yml b/.github/workflows/preproductionDeployment.yml index 88cf219e4333..a9aff8de63cf 100644 --- a/.github/workflows/preproductionDeployment.yml +++ b/.github/workflows/preproductionDeployment.yml @@ -49,11 +49,10 @@ jobs: azure_static_web_apps_api_token: ${{ env.AZURE_STATIC_WEB_APPS_API_TOKEN }} repo_token: ${{ secrets.GITHUB_TOKEN }} # Automatically provided by GitHub action: "upload" - ###### Repository/Build Configurations - Adjust these values as needed ###### app_location: ${{ env.APP_LOCATION }} api_location: ${{ env.API_LOCATION }} app_artifact_location: ${{ env.APP_ARTIFACT_LOCATION }} - ###### End of Repository/Build Configurations ###### + deployment_environment: "staging" # Step 5: Post Deployment Feedback (Optional) - name: Post Deployment URL as PR Comment From 83cd6b727f7da160cb4ec994f8669c110b8e39bf Mon Sep 17 00:00:00 2001 From: Wayne Ferrao Date: Wed, 20 Nov 2024 15:54:57 -0800 Subject: [PATCH 20/33] fixes --- .github/workflows/preproductionDeployment.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/preproductionDeployment.yml b/.github/workflows/preproductionDeployment.yml index a9aff8de63cf..62cd8b49644d 100644 --- a/.github/workflows/preproductionDeployment.yml +++ b/.github/workflows/preproductionDeployment.yml @@ -25,23 +25,24 @@ jobs: with: submodules: true - # Step 2: Set up Node.js (Adjust version as needed) + # Step 2: Set up Node.js - name: Setup Node.js uses: actions/setup-node@v3 with: node-version: '18.18' + # Step 3: Install pnpm - name: Install pnpm run: npm install -g pnpm - # Step 3: Install Dependencies - - name: Install Dependencies + # Step 4: Use pnpm for workspace setup and build + - name: Install and Build with pnpm run: | cd docs - pnpm i --frozen-lockfile + pnpm install --frozen-lockfile pnpm run build - # Step 4: Deploy to Azure Static Web Apps (Preprod) + # Step 5: Deploy to Azure Static Web Apps (Preprod) - name: Deploy to Azure Static Web Apps (Preprod) id: deploy uses: Azure/static-web-apps-deploy@v1 @@ -54,7 +55,7 @@ jobs: app_artifact_location: ${{ env.APP_ARTIFACT_LOCATION }} deployment_environment: "staging" - # Step 5: Post Deployment Feedback (Optional) + # Step 6: Post Deployment Feedback (Optional) - name: Post Deployment URL as PR Comment if: success() uses: actions/github-script@v6 From 918ab64ce392510bbba099a9f317bb5cbc98097c Mon Sep 17 00:00:00 2001 From: Wayne Ferrao Date: Wed, 20 Nov 2024 16:10:22 -0800 Subject: [PATCH 21/33] skip oryx build --- .github/workflows/preproductionDeployment.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/preproductionDeployment.yml b/.github/workflows/preproductionDeployment.yml index 62cd8b49644d..27340c0f2589 100644 --- a/.github/workflows/preproductionDeployment.yml +++ b/.github/workflows/preproductionDeployment.yml @@ -13,7 +13,7 @@ env: permissions: contents: read - pull-requests: write # Needed for posting comments on PRs + pull-requests: write jobs: build_and_deploy: @@ -54,6 +54,7 @@ jobs: api_location: ${{ env.API_LOCATION }} app_artifact_location: ${{ env.APP_ARTIFACT_LOCATION }} deployment_environment: "staging" + skip_app_build: true # Step 6: Post Deployment Feedback (Optional) - name: Post Deployment URL as PR Comment From 9e782757778cdede53fb47d7a37aa18bb6a27d40 Mon Sep 17 00:00:00 2001 From: Wayne Ferrao Date: Wed, 20 Nov 2024 16:21:44 -0800 Subject: [PATCH 22/33] update locations --- .github/workflows/preproductionDeployment.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/preproductionDeployment.yml b/.github/workflows/preproductionDeployment.yml index 27340c0f2589..0fe405307a01 100644 --- a/.github/workflows/preproductionDeployment.yml +++ b/.github/workflows/preproductionDeployment.yml @@ -6,9 +6,9 @@ on: branches: [ "main" ] # Adjust if your default branch is different env: - APP_LOCATION: "/" # Location of your client code - API_LOCATION: "api" # Location of your API source code (optional) - APP_ARTIFACT_LOCATION: "build" # Location where the build artifacts are generated + APP_LOCATION: "docs " # Location of your client code + API_LOCATION: "docs/api" # Location of your API source code (optional) + APP_ARTIFACT_LOCATION: "docs/build" # Location where the build artifacts are generated AZURE_STATIC_WEB_APPS_API_TOKEN: ${{ secrets.AZURE_STATIC_WEB_APPS_PREPROD_API_TOKEN }} # Preprod SWA deployment token permissions: From 89a8b882240685cc80067e341dad59a97dd7e59c Mon Sep 17 00:00:00 2001 From: Wayne Ferrao Date: Wed, 20 Nov 2024 16:32:29 -0800 Subject: [PATCH 23/33] update locations --- .github/workflows/preproductionDeployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/preproductionDeployment.yml b/.github/workflows/preproductionDeployment.yml index 0fe405307a01..bad5d4c302d1 100644 --- a/.github/workflows/preproductionDeployment.yml +++ b/.github/workflows/preproductionDeployment.yml @@ -6,7 +6,7 @@ on: branches: [ "main" ] # Adjust if your default branch is different env: - APP_LOCATION: "docs " # Location of your client code + APP_LOCATION: "docs" # Location of your client code API_LOCATION: "docs/api" # Location of your API source code (optional) APP_ARTIFACT_LOCATION: "docs/build" # Location where the build artifacts are generated AZURE_STATIC_WEB_APPS_API_TOKEN: ${{ secrets.AZURE_STATIC_WEB_APPS_PREPROD_API_TOKEN }} # Preprod SWA deployment token From d60f4177c1ed07a9d305fd6cd141470a9c9fc2d3 Mon Sep 17 00:00:00 2001 From: Wayne Ferrao Date: Wed, 20 Nov 2024 16:57:07 -0800 Subject: [PATCH 24/33] update locations --- .github/workflows/preproductionDeployment.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/preproductionDeployment.yml b/.github/workflows/preproductionDeployment.yml index bad5d4c302d1..763679a1ad68 100644 --- a/.github/workflows/preproductionDeployment.yml +++ b/.github/workflows/preproductionDeployment.yml @@ -6,9 +6,9 @@ on: branches: [ "main" ] # Adjust if your default branch is different env: - APP_LOCATION: "docs" # Location of your client code - API_LOCATION: "docs/api" # Location of your API source code (optional) - APP_ARTIFACT_LOCATION: "docs/build" # Location where the build artifacts are generated + APP_LOCATION: "./docs" # Location of your client code + API_LOCATION: "./docs/api" # Location of your API source code (optional) + APP_ARTIFACT_LOCATION: "./docs/build" # Location where the build artifacts are generated AZURE_STATIC_WEB_APPS_API_TOKEN: ${{ secrets.AZURE_STATIC_WEB_APPS_PREPROD_API_TOKEN }} # Preprod SWA deployment token permissions: From 8422f06104d1e51c9c19f3192054f6c45d0e1a48 Mon Sep 17 00:00:00 2001 From: Wayne Ferrao Date: Wed, 20 Nov 2024 17:11:50 -0800 Subject: [PATCH 25/33] update locations --- .github/workflows/preproductionDeployment.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/preproductionDeployment.yml b/.github/workflows/preproductionDeployment.yml index 763679a1ad68..dfcf9d1d30b5 100644 --- a/.github/workflows/preproductionDeployment.yml +++ b/.github/workflows/preproductionDeployment.yml @@ -6,9 +6,9 @@ on: branches: [ "main" ] # Adjust if your default branch is different env: - APP_LOCATION: "./docs" # Location of your client code - API_LOCATION: "./docs/api" # Location of your API source code (optional) - APP_ARTIFACT_LOCATION: "./docs/build" # Location where the build artifacts are generated + APP_LOCATION: "docs/build" # Location of your client code + API_LOCATION: "docs/api" # Location of your API source code (optional) + APP_ARTIFACT_LOCATION: "docs/build" # Location where the build artifacts are generated AZURE_STATIC_WEB_APPS_API_TOKEN: ${{ secrets.AZURE_STATIC_WEB_APPS_PREPROD_API_TOKEN }} # Preprod SWA deployment token permissions: From c93e6fefa74ab53b81d3915b5dd7097107159070 Mon Sep 17 00:00:00 2001 From: Wayne Ferrao Date: Wed, 20 Nov 2024 17:26:12 -0800 Subject: [PATCH 26/33] Update comment script --- .github/workflows/preproductionDeployment.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/preproductionDeployment.yml b/.github/workflows/preproductionDeployment.yml index dfcf9d1d30b5..392c556c14d2 100644 --- a/.github/workflows/preproductionDeployment.yml +++ b/.github/workflows/preproductionDeployment.yml @@ -59,11 +59,11 @@ jobs: # Step 6: Post Deployment Feedback (Optional) - name: Post Deployment URL as PR Comment if: success() - uses: actions/github-script@v6 + uses: actions/github-script@v7 with: script: | const url = '${{ steps.deploy.outputs.preview_url }}'; - github.issues.createComment({ + await github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, From edb87f463b03ea1b0285d5a52fbe342e06d151d1 Mon Sep 17 00:00:00 2001 From: Wayne Ferrao Date: Thu, 21 Nov 2024 12:01:42 -0800 Subject: [PATCH 27/33] Cleanup --- .github/workflows/preproductionDeployment.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/preproductionDeployment.yml b/.github/workflows/preproductionDeployment.yml index 392c556c14d2..df7b38ebbacd 100644 --- a/.github/workflows/preproductionDeployment.yml +++ b/.github/workflows/preproductionDeployment.yml @@ -3,13 +3,13 @@ name: Preproduction Deployment on: pull_request: types: [opened, synchronize, reopened] - branches: [ "main" ] # Adjust if your default branch is different + branches: [ "main" ] env: - APP_LOCATION: "docs/build" # Location of your client code - API_LOCATION: "docs/api" # Location of your API source code (optional) - APP_ARTIFACT_LOCATION: "docs/build" # Location where the build artifacts are generated - AZURE_STATIC_WEB_APPS_API_TOKEN: ${{ secrets.AZURE_STATIC_WEB_APPS_PREPROD_API_TOKEN }} # Preprod SWA deployment token + APP_LOCATION: "docs/build" + API_LOCATION: "docs/api" + APP_ARTIFACT_LOCATION: "docs/build" + AZURE_STATIC_WEB_APPS_API_TOKEN: ${{ secrets.AZURE_STATIC_WEB_APPS_PREPROD_API_TOKEN }} permissions: contents: read From cba147f9d450344d0efdbead696acc4d335f5c26 Mon Sep 17 00:00:00 2001 From: Wayne Ferrao Date: Thu, 21 Nov 2024 12:15:09 -0800 Subject: [PATCH 28/33] Remove old workflows add logging --- ...static-web-apps-happy-pebble-0ab98d51e.yml | 70 ------------------- ...tatic-web-apps-orange-meadow-01ae28c10.yml | 46 ------------ .github/workflows/azure-staticwebapp.yml | 66 ----------------- .github/workflows/preproductionDeployment.yml | 1 + docs/api-docs-build-manifest.json | 0 5 files changed, 1 insertion(+), 182 deletions(-) delete mode 100644 .github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml delete mode 100644 .github/workflows/azure-static-web-apps-orange-meadow-01ae28c10.yml delete mode 100644 .github/workflows/azure-staticwebapp.yml create mode 100644 docs/api-docs-build-manifest.json diff --git a/.github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml b/.github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml deleted file mode 100644 index 1bdf5d7c38f5..000000000000 --- a/.github/workflows/azure-static-web-apps-happy-pebble-0ab98d51e.yml +++ /dev/null @@ -1,70 +0,0 @@ -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 - # Step to install pnpm - - name: Install pnpm - run: npm install -g pnpm@8 - - # Install dependencies using pnpm - - name: Install dependencies - working-directory: packages/tools/devtools/devtools-example - run: pnpm install - - # Build the project using pnpm - - name: Build the project - working-directory: packages/tools/devtools/devtools-example - run: pnpm run build - # Set up environment variables for Oryx - - name: Set up environment variables for Oryx - run: | - echo 'export ENABLE_DYNAMIC_INSTALL=true' >> $GITHUB_ENV - echo 'export ENABLE_NODE_MONOREPO=true' >> $GITHUB_ENV - echo 'export NODE_VERSION=16' >> $GITHUB_ENV - echo 'LOG_LEVEL=debug' >> $GITHUB_ENV - - - 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_HAPPY_PEBBLE_0AB98D51E }} - 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: "packages/tools/devtools/devtools-example" # App source code path - api_location: "" # Api source code path - optional - build_timeout_in_minutes: 90 - output_location: '' # Built app content directory - optional - skip_app_build: true - skip_api_build: true - ###### 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_HAPPY_PEBBLE_0AB98D51E }} - action: "close" diff --git a/.github/workflows/azure-static-web-apps-orange-meadow-01ae28c10.yml b/.github/workflows/azure-static-web-apps-orange-meadow-01ae28c10.yml deleted file mode 100644 index e9a9431cfff2..000000000000 --- a/.github/workflows/azure-static-web-apps-orange-meadow-01ae28c10.yml +++ /dev/null @@ -1,46 +0,0 @@ -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_ORANGE_MEADOW_01AE28C10 }} - 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: "/" # App source code path - api_location: "" # Api source code path - optional - output_location: "" # 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_ORANGE_MEADOW_01AE28C10 }} - action: "close" diff --git a/.github/workflows/azure-staticwebapp.yml b/.github/workflows/azure-staticwebapp.yml deleted file mode 100644 index 8f302740fadf..000000000000 --- a/.github/workflows/azure-staticwebapp.yml +++ /dev/null @@ -1,66 +0,0 @@ -name: Preproduction Deployment - -on: - pull_request: - types: [opened, synchronize, reopened] - branches: [ "main" ] # Adjust if your default branch is different - -env: - APP_LOCATION: "/" # Location of your client code - API_LOCATION: "api" # Location of your API source code (optional) - APP_ARTIFACT_LOCATION: "build" # Location where the build artifacts are generated - AZURE_STATIC_WEB_APPS_API_TOKEN: ${{ secrets.AZURE_STATIC_WEB_APPS_PREPROD_API_TOKEN }} # Preprod SWA deployment token - -permissions: - contents: read - pull-requests: write # Needed for posting comments on PRs - -jobs: - build_and_deploy: - runs-on: ubuntu-latest - name: Build and Deploy to Preprod SWA - steps: - # Step 1: Checkout the repository - - uses: actions/checkout@v4 - with: - submodules: true - - # Step 2: Set up Node.js (Adjust version as needed) - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: '16' # Specify your Node.js version - - # Step 3: Install Dependencies - - name: Install Dependencies - run: | - npm install - npm run build # Modify if your build command is different - - # Step 4: Deploy to Azure Static Web Apps (Preprod) - - name: Deploy to Azure Static Web Apps (Preprod) - id: deploy - uses: Azure/static-web-apps-deploy@v1 - with: - azure_static_web_apps_api_token: ${{ env.AZURE_STATIC_WEB_APPS_API_TOKEN }} - repo_token: ${{ secrets.GITHUB_TOKEN }} # Automatically provided by GitHub - action: "upload" - ###### Repository/Build Configurations - Adjust these values as needed ###### - app_location: ${{ env.APP_LOCATION }} - api_location: ${{ env.API_LOCATION }} - app_artifact_location: ${{ env.APP_ARTIFACT_LOCATION }} - ###### End of Repository/Build Configurations ###### - - # Step 5: Post Deployment Feedback (Optional) - - name: Post Deployment URL as PR Comment - if: success() - uses: actions/github-script@v6 - with: - script: | - const url = '${{ steps.deploy.outputs.preview_url }}'; - github.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: `✅ **Pre-production Deployment Successful** 🚀\n\nYou can view the changes here: ${url}` - }); diff --git a/.github/workflows/preproductionDeployment.yml b/.github/workflows/preproductionDeployment.yml index df7b38ebbacd..73e1bb3661e8 100644 --- a/.github/workflows/preproductionDeployment.yml +++ b/.github/workflows/preproductionDeployment.yml @@ -63,6 +63,7 @@ jobs: with: script: | const url = '${{ steps.deploy.outputs.preview_url }}'; + console.log(url); await github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, diff --git a/docs/api-docs-build-manifest.json b/docs/api-docs-build-manifest.json new file mode 100644 index 000000000000..e69de29bb2d1 From 34a8d815e7a8a6e0be0c10e2f43d608630a4f286 Mon Sep 17 00:00:00 2001 From: Wayne Ferrao Date: Thu, 21 Nov 2024 12:31:42 -0800 Subject: [PATCH 29/33] update comment --- .github/workflows/preproductionDeployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/preproductionDeployment.yml b/.github/workflows/preproductionDeployment.yml index 73e1bb3661e8..a016fecf8637 100644 --- a/.github/workflows/preproductionDeployment.yml +++ b/.github/workflows/preproductionDeployment.yml @@ -62,7 +62,7 @@ jobs: uses: actions/github-script@v7 with: script: | - const url = '${{ steps.deploy.outputs.preview_url }}'; + const url = '${{ steps.deploy.outputs.deployment_url }}'; console.log(url); await github.rest.issues.createComment({ issue_number: context.issue.number, From 1a7340950afa53fb0cbc22bf2a2bf771e4cce042 Mon Sep 17 00:00:00 2001 From: Wayne Ferrao Date: Thu, 21 Nov 2024 12:41:50 -0800 Subject: [PATCH 30/33] Remove comment --- .github/workflows/preproductionDeployment.yml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/.github/workflows/preproductionDeployment.yml b/.github/workflows/preproductionDeployment.yml index a016fecf8637..328318de6d62 100644 --- a/.github/workflows/preproductionDeployment.yml +++ b/.github/workflows/preproductionDeployment.yml @@ -55,18 +55,3 @@ jobs: app_artifact_location: ${{ env.APP_ARTIFACT_LOCATION }} deployment_environment: "staging" skip_app_build: true - - # Step 6: Post Deployment Feedback (Optional) - - name: Post Deployment URL as PR Comment - if: success() - uses: actions/github-script@v7 - with: - script: | - const url = '${{ steps.deploy.outputs.deployment_url }}'; - console.log(url); - await github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: `✅ **Pre-production Deployment Successful** 🚀\n\nYou can view the changes here: ${url}` - }); From 42758e61b99bbf636e63066fdf2cfb73518285aa Mon Sep 17 00:00:00 2001 From: Wayne Ferrao Date: Thu, 21 Nov 2024 12:54:30 -0800 Subject: [PATCH 31/33] Customize domain name --- .github/workflows/preproductionDeployment.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/preproductionDeployment.yml b/.github/workflows/preproductionDeployment.yml index 328318de6d62..65972a709b9d 100644 --- a/.github/workflows/preproductionDeployment.yml +++ b/.github/workflows/preproductionDeployment.yml @@ -55,3 +55,9 @@ jobs: app_artifact_location: ${{ env.APP_ARTIFACT_LOCATION }} deployment_environment: "staging" skip_app_build: true + + - name: Set Custom Domain for Preprod + run: | + az staticwebapp hostname set --name \ + --hostname "fluidframework-staging-pr${{ github.event.pull_request.number }}.azurestaticapps.net" \ + --token ${{ secrets.AZURE_STATIC_WEB_APPS_PREPROD_API_TOKEN }} From 318105ab75c5b2d8f866d7fe3aafd606703dea0a Mon Sep 17 00:00:00 2001 From: Wayne Ferrao Date: Thu, 21 Nov 2024 13:03:45 -0800 Subject: [PATCH 32/33] update name --- .github/workflows/preproductionDeployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/preproductionDeployment.yml b/.github/workflows/preproductionDeployment.yml index 65972a709b9d..c518741460b9 100644 --- a/.github/workflows/preproductionDeployment.yml +++ b/.github/workflows/preproductionDeployment.yml @@ -58,6 +58,6 @@ jobs: - name: Set Custom Domain for Preprod run: | - az staticwebapp hostname set --name \ + az staticwebapp hostname set --name preProdEnvironment \ --hostname "fluidframework-staging-pr${{ github.event.pull_request.number }}.azurestaticapps.net" \ --token ${{ secrets.AZURE_STATIC_WEB_APPS_PREPROD_API_TOKEN }} From b9b49f5f4e4234aa11246768ae13a9e24d1ca832 Mon Sep 17 00:00:00 2001 From: Wayne Ferrao Date: Thu, 21 Nov 2024 13:23:25 -0800 Subject: [PATCH 33/33] update environment to preview --- .github/workflows/preproductionDeployment.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/preproductionDeployment.yml b/.github/workflows/preproductionDeployment.yml index c518741460b9..bbdf628fd1bd 100644 --- a/.github/workflows/preproductionDeployment.yml +++ b/.github/workflows/preproductionDeployment.yml @@ -18,7 +18,7 @@ permissions: jobs: build_and_deploy: runs-on: ubuntu-latest - name: Build and Deploy to Preprod SWA + name: Build and Deploy to Preview Environment steps: # Step 1: Checkout the repository - uses: actions/checkout@v4 @@ -53,11 +53,5 @@ jobs: app_location: ${{ env.APP_LOCATION }} api_location: ${{ env.API_LOCATION }} app_artifact_location: ${{ env.APP_ARTIFACT_LOCATION }} - deployment_environment: "staging" + deployment_environment: "preview" skip_app_build: true - - - name: Set Custom Domain for Preprod - run: | - az staticwebapp hostname set --name preProdEnvironment \ - --hostname "fluidframework-staging-pr${{ github.event.pull_request.number }}.azurestaticapps.net" \ - --token ${{ secrets.AZURE_STATIC_WEB_APPS_PREPROD_API_TOKEN }}