ci(docs): docs workflow with Nx affected gating and iconized steps - #28
Conversation
…, and iconized step names
📝 WalkthroughWalkthroughAdds a new GitHub Actions workflow Changes
Sequence Diagram(s)sequenceDiagram
participant Push as Developer Push
participant GH as GitHub Actions
participant Repo as Repository
participant Node as Node/pnpm Setup
participant NX as nx Build
participant Art as Artifact Upload
participant Pages as GitHub Pages
Push->>GH: push to master
GH->>Repo: checkout (full history)
GH->>Node: install Node + pnpm (with cache)
GH->>Repo: pnpm install
GH->>NX: run `nx affected --target=build --projects=@effectify/docs` (BASE from previous commit)
NX-->>GH: build output (`apps/docs/dist`) or nothing
alt docs produced
GH->>Art: upload `apps/docs/dist`
GH->>Pages: configure & deploy artifact
else no docs affected
GH-->>Push: skip deployment (message)
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 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)
Comment |
|
View your CI Pipeline Execution ↗ for commit a24ce9e
☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In @.github/workflows/docs.yml:
- Around line 75-77: The YAML parser misinterprets the colon in the run string
for the step named "⏭️ Skip deploy (docs not affected)"; replace the single-line
run value with a block scalar to avoid ambiguity (use run: | and put the echo
command on the next line), e.g. convert the current run: echo "Skipping deploy:
`@effectify/docs` is not affected in this push." into a block scalar that contains
the echo command so the colon is treated as part of the string rather than a
mapping separator.
- Around line 43-58: The step currently swallows real build failures via the
trailing "|| true" on the pnpm nx command; remove the "|| true", run the pnpm nx
affected -t build --base="${BASE}" --head="${HEAD}" --projects="@effectify/docs"
command and immediately capture its exit code (e.g., rc=$?), then: if rc is
non-zero, echo "should_deploy=false" to GITHUB_OUTPUT and exit with that rc so
the job fails on real build errors; otherwise (rc == 0) check for the
apps/docs/dist directory and set should_deploy=true/false accordingly. Reference
the affected_build job id and the pnpm nx affected invocation plus the
apps/docs/dist existence check to locate where to apply this change.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In @.github/workflows/docs.yml:
- Around line 52-57: The echo and pnpm commands are using backticks around the
project identifier `@effectify/docs`, causing shell command substitution and
failing; replace those backticks with single or double quotes so the literal
string `@effectify/docs` is used. Update the two occurrences inside the if/else
block (the echo message "pnpm nx build `@effectify/docs`" and the echo "Running
nx affected build for `@effectify/docs`...") and the pnpm nx build invocation to
use quoted "@effectify/docs" (or '@effectify/docs') instead of backticks.
- Around line 80-83: The echo line inside the "⏭️ Skip deploy (docs not
affected)" step uses backticks around `@effectify/docs` which triggers shell
command substitution; change the echo to use safe quoting (e.g., single quotes)
or escape the backticks so the literal string `@effectify/docs` is printed when
the condition on steps.affected_build.outputs.should_deploy is not 'true'.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* ci(docs): add docs workflow with Nx affected gating, English messages, and iconized step names * Update .github/workflows/docs.yml Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update .github/workflows/docs.yml Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update .github/workflows/docs.yml Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Summary by CodeRabbit