fix: run documentation deployment in parallel with tests - #734
Conversation
- Add build-docs job to sonarcloud.yml that runs in parallel with tests - Documentation deploys immediately after build completes on master - Remove broken workflow_run trigger from docs.yml - Keep docs.yml for manual dispatch only with skip_playground option - Use pinned action versions with SHA hashes for security This fixes the issue where documentation wasn't deploying because the workflow_run trigger would skip when Build & SonarCloud had failures. Now docs deploy as soon as the build artifact is available. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings. WalkthroughConverted the docs workflow to manual Changes
Sequence Diagram(s)sequenceDiagram
participant Trigger as Trigger (push or manual)
participant Actions as GitHub Actions
participant Dotnet as .NET / NuGet
participant DocFX as DocFX
participant Playground as Blazor Playground
participant Pages as GitHub Pages
Trigger->>Actions: start build-docs job
Actions->>Dotnet: setup dotnet, restore, cache NuGet
Actions->>DocFX: install & run docfx build
alt Playground not skipped
Actions->>Playground: dotnet publish playground
Playground-->>Actions: built playground assets
Actions->>DocFX: copy playground into docs site
end
Actions->>Pages: upload artifacts
Actions->>Pages: deploy to GitHub Pages (master only)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR fixes the broken documentation deployment by moving it from a separate workflow_run triggered workflow into the main Build & SonarCloud workflow, allowing documentation to deploy in parallel with tests and independently of test results.
Changes:
- Moved documentation deployment to run in parallel with tests in the
Build & SonarCloudworkflow - Converted the
docs.ymlworkflow to manual-only with an optionalskip_playgroundparameter for faster doc-only rebuilds - Removed the unreliable
workflow_runtrigger and third-party artifact download action
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
.github/workflows/sonarcloud.yml |
Added new build-docs job that builds DocFX documentation and Blazor playground, then deploys to GitHub Pages on master branch pushes |
.github/workflows/docs.yml |
Converted to manual-only workflow, removed workflow_run trigger, simplified artifact handling, added skip_playground option for faster doc-only rebuilds |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @.github/workflows/docs.yml:
- Around line 63-78: Replace the fragile boolean negation condition used on the
three playground steps ("Restore Playground dependencies", "Build Blazor WASM
Playground", "Copy Playground to documentation site") and change each if: ${{
!inputs.skip_playground }} to an explicit string comparison if: ${{
inputs.skip_playground != 'true' }} so the workflow reliably skips the
playground when the input is set to 'true'.
🧹 Nitpick comments (2)
.github/workflows/docs.yml (1)
59-61: Prevent deploying an empty docs site if DocFX errors.
continue-on-error: truecan allow a failed DocFX run to proceed, and later steps can still create_site. Consider asserting that DocFX produced output before uploading.🛡️ Suggested guard step
- name: Build DocFX documentation run: docfx docfx.json continue-on-error: true # Don't fail deployment due to docfx warnings + - name: Fail if DocFX did not produce site + if: ${{ always() }} + run: | + if [ ! -f _site/index.html ]; then + echo "DocFX output missing"; exit 1 + fi.github/workflows/sonarcloud.yml (1)
592-595: Guard against DocFX failures before deployment.With
continue-on-error: true, a DocFX failure can still deploy an empty_site(the Playground copy creates the directory). Consider a post-step check to fail if_site/index.htmlis missing.🛡️ Suggested guard step
- name: Build DocFX documentation run: docfx docfx.json continue-on-error: true # Don't fail deployment due to docfx warnings + - name: Fail if DocFX did not produce site + if: ${{ always() }} + run: | + if [ ! -f _site/index.html ]; then + echo "DocFX output missing"; exit 1 + fi
|
- Use explicit boolean comparison for skip_playground input - Add warning message when deployment skipped on non-master branch - Conditionally show playground link only when playground was built - Remove unnecessary artifact download (DocFX builds from source) - Add comment explaining why artifacts are not downloaded Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>



Summary
This PR fixes the documentation and Blazor Playground deployment that was broken after PR #731 was merged.
Problem
The previous workflow design had a fundamental flaw:
docs.ymltriggered viaworkflow_runonly whenBuild & SonarCloudsucceededdawidd6/action-download-artifactaction was failing with "Not Found" errors/api/and/playground/URLs returned 404Solution
Architecture Change: Move documentation deployment into
sonarcloud.ymlto run in parallel with tests:Key Benefits:
Changes
.github/workflows/sonarcloud.yml:build-docsjob that runs in parallel with tests.github/workflows/docs.yml:workflow_runtriggerworkflow_dispatchfor manual rebuildsskip_playgroundoption for faster doc-only rebuildsTesting
Test plan
Build & SonarCloudworkflow runbuild-docsjob runs in parallel with testsGenerated with Claude Code