Skip to content

Fix/azure static web apps deployment#2

Merged
newbe36524 merged 2 commits intomainfrom
fix/azure-static-web-apps-deployment
Feb 5, 2026
Merged

Fix/azure static web apps deployment#2
newbe36524 merged 2 commits intomainfrom
fix/azure-static-web-apps-deployment

Conversation

@newbe36524
Copy link
Contributor

@newbe36524 newbe36524 commented Feb 5, 2026

Summary by CodeRabbit

  • Bug Fixes

    • Resolved Azure Static Web Apps deployment workflow configuration and execution issues.
  • New Features

    • Added single-page application (SPA) client-side routing support.
  • Chores

    • Updated CI/CD workflow with improved build process, explicit dependency and build steps, and verbose logging for better debugging.
  • Documentation

    • Added comprehensive deployment configuration requirements and task-based implementation guides.

newbe36524 and others added 2 commits February 5, 2026 21:59
- 修复 output_location 从 "build" 改为 "dist",与 Vite 配置一致
- 升级 actions/checkout 从 v3 到 v4
- 添加显式 Node.js 20 设置和构建步骤
- 添加 skip_app_build: true 跳过 Azure 重复构建
- 添加 verbose: true 启用详细日志
- 创建 public/staticwebapp.config.json 支持 React Router 客户端路由

这些修改将使 Azure Static Web Apps 部署成功,并确保 React Router 的客户端路由正常工作。

参考: OpenSpec proposal fix-azure-static-web-apps-deployment-arg-value

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@coderabbitai
Copy link

coderabbitai bot commented Feb 5, 2026

📝 Walkthrough

Walkthrough

This PR restructures the Azure Static Web Apps deployment workflow by upgrading action versions, adding explicit build steps, adjusting deployment directories from "build" to "dist", and introducing SPA routing support via staticwebapp.config.json. Supporting documentation specifies requirements, tasks, and implementation guidance for the deployment configuration changes.

Changes

Cohort / File(s) Summary
GitHub Workflow Restructuring
.github/workflows/azure-static-web-apps-ambitious-moss-03f17d600.yml
Upgraded actions/checkout@v3 to v4, added explicit Node.js setup and npm ci steps, restructured build configuration with app_location and output_location adjustments (dist and .), enabled skip_app_build and verbose logging.
SPA Routing Configuration
public/staticwebapp.config.json
Added new static web app config file with navigationFallback rule to rewrite all routes to index.html, enabling client-side SPA routing.
Deployment Documentation
openspec/changes/archive/2026-02-05-fix-azure-static-web-apps-deployment-arg-value/proposal.md, ...spec.md, ...tasks.md
Documented deployment workflow fix with proposal overview, comprehensive requirements for code push triggers, PR previews, failure notifications and SPA routing support, plus structured task checklist with examples and validation steps.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A rabbit hops with tools so bright,
Building workflows, azure light!
From build to dist, the paths now clear,
SPA routing brings cheer!
Docs spell it out, so neat and small,
This deployment fix handles it all! 🚀

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix/azure static web apps deployment' is directly related to the changeset, which focuses on fixing Azure Static Web Apps deployment configuration issues.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/azure-static-web-apps-deployment

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Feb 5, 2026

✅ CI check result: Passed

Workflow: CI
Status: success
Branch: fix/azure-static-web-apps-deployment
Commit: af36196

All tests passed and build completed successfully.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/azure-static-web-apps-ambitious-moss-03f17d600.yml (1)

27-47: ⚠️ Potential issue | 🟡 Minor

Move Setup Node.js before any npm command for consistency.

npm install runs before Node 20 is configured. While this repo doesn't have engines constraints in package.json, running npm commands across different Node versions in the same job is inefficient. Configure Node.js first, then run all npm commands with a consistent version.

✅ Suggested reorder
-      - name: Install OIDC Client from Core Package
-        run: npm install `@actions/core`@1.6.0 `@actions/http-client`
-
-      - name: Get Id Token
-        uses: actions/github-script@v6
-        id: idtoken
-        with:
-           script: |
-               const coredemo = require('@actions/core')
-               return await coredemo.getIDToken()
-           result-encoding: string
-
       - name: Setup Node.js
         uses: actions/setup-node@v4
         with:
           node-version: '20'
           cache: 'npm'
+
+      - name: Install OIDC Client from Core Package
+        run: npm install `@actions/core`@1.6.0 `@actions/http-client`
+
+      - name: Get Id Token
+        uses: actions/github-script@v6
+        id: idtoken
+        with:
+           script: |
+               const coredemo = require('@actions/core')
+               return await coredemo.getIDToken()
+           result-encoding: string
🤖 Fix all issues with AI agents
In
`@openspec/changes/archive/2026-02-05-fix-azure-static-web-apps-deployment-arg-value/proposal.md`:
- Around line 42-45: Update the "Execution Date" field in the proposal header
from "2025-02-05" to "2026-02-05" so the archived change date matches the
branch/PR date; locate the "Execution Date" line in the document (near the
"Status" and "Executed By" header fields) and replace the incorrect year.

In
`@openspec/changes/archive/2026-02-05-fix-azure-static-web-apps-deployment-arg-value/tasks.md`:
- Line 73: Replace the wording "必需配置" in the sentence "此文件是 Azure Static Web
Apps 的必需配置,用于处理单页应用(SPA)的客户端路由:" with the more natural phrasing "必要配置" (or
"必须的配置") so the line reads "此文件是 Azure Static Web Apps
的必要配置,用于处理单页应用(SPA)的客户端路由:" — locate this text in tasks.md and update the phrase
only, preserving the rest of the sentence and punctuation.

Comment on lines +42 to +45
**Status**: ExecutionCompleted
**Executed By**: Claude Sonnet 4.5
**Execution Date**: 2025-02-05
**Branch**: fix/azure-static-web-apps-deployment
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix the execution date mismatch.

This change is archived under 2026-02-05 and the PR was created on 2026-02-05, but the execution date says 2025-02-05. That should be 2026-02-05 to avoid timeline confusion.

📅 Suggested fix
-**Execution Date**: 2025-02-05
+**Execution Date**: 2026-02-05
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
**Status**: ExecutionCompleted
**Executed By**: Claude Sonnet 4.5
**Execution Date**: 2025-02-05
**Branch**: fix/azure-static-web-apps-deployment
**Status**: ExecutionCompleted
**Executed By**: Claude Sonnet 4.5
**Execution Date**: 2026-02-05
**Branch**: fix/azure-static-web-apps-deployment
🤖 Prompt for AI Agents
In
`@openspec/changes/archive/2026-02-05-fix-azure-static-web-apps-deployment-arg-value/proposal.md`
around lines 42 - 45, Update the "Execution Date" field in the proposal header
from "2025-02-05" to "2026-02-05" so the archived change date matches the
branch/PR date; locate the "Execution Date" line in the document (near the
"Status" and "Executed By" header fields) and replace the incorrect year.

5. 如需回滚,删除 `public/staticwebapp.config.json` 并恢复原始工作流配置文件

## staticwebapp.config.json 配置说明
此文件是 Azure Static Web Apps 的必需配置,用于处理单页应用(SPA)的客户端路由:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Wording polish: use “必要配置/必须的配置” instead of “必需配置”.

This reads more naturally in Chinese technical docs.

✏️ Suggested edit
-此文件是 Azure Static Web Apps 的必需配置,用于处理单页应用(SPA)的客户端路由:
+此文件是 Azure Static Web Apps 的必要配置,用于处理单页应用(SPA)的客户端路由:
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
此文件是 Azure Static Web Apps 的必需配置,用于处理单页应用(SPA)的客户端路由:
此文件是 Azure Static Web Apps 的必要配置,用于处理单页应用(SPA)的客户端路由:
🧰 Tools
🪛 LanguageTool

[uncategorized] ~73-~73: "必需"后面不应接动词,您的意思是""必须""吗?
Context: ...g.json 配置说明 此文件是 Azure Static Web Apps 的必需配置,用于处理单页应用(SPA)的客户端路由: ```json { "navi...

(ZH2)

🤖 Prompt for AI Agents
In
`@openspec/changes/archive/2026-02-05-fix-azure-static-web-apps-deployment-arg-value/tasks.md`
at line 73, Replace the wording "必需配置" in the sentence "此文件是 Azure Static Web
Apps 的必需配置,用于处理单页应用(SPA)的客户端路由:" with the more natural phrasing "必要配置" (or
"必须的配置") so the line reads "此文件是 Azure Static Web Apps
的必要配置,用于处理单页应用(SPA)的客户端路由:" — locate this text in tasks.md and update the phrase
only, preserving the rest of the sentence and punctuation.

@newbe36524 newbe36524 merged commit 437be98 into main Feb 5, 2026
4 checks passed
@newbe36524 newbe36524 deleted the fix/azure-static-web-apps-deployment branch February 5, 2026 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant