fix(ci): use static/img pathspec in deploy content checkouts#183
fix(ci): use static/img pathspec in deploy content checkouts#183luandro wants to merge 1 commit into
Conversation
Deploy workflows checked out docs/ i18n/ static/images/ from the content branch, but image assets live at static/img/ (tracked on both main and content). static/images/ does not exist, so the checkout failed with 'pathspec did not match any file(s)'. - deploy-production.yml: production deploys died at content checkout - deploy-staging.yml: staging died the same way; trigger decision grep and paths filter also referenced the wrong dir - deploy-test.yml: same unguarded hard-fail - deploy-pr-preview.yml: guarded with fallback, so previews silently built without content-sourced images Updates checkout pathspec, trigger decision grep, paths filter, and the empty-dir guards/counters across all four deploy workflows. Not addressed here (separate concerns): - content-lock.sha on main points at a dead SHA (9849108) wiped by a content-branch rebase. Fixed by running deploy-production via workflow_dispatch, which repromotes origin/content HEAD into the lock. - translate-docs.yml + .gitignore still reference static/images/ as part of the content-branch gitignore management; left untouched to avoid disrupting the content sync mechanism.
PR Summary by QodoFix deploy workflows to checkout static/img from content branch
AI Description
Diagram
High-Level Assessment
Files changed (4)
|
🚀 Preview DeploymentYour documentation preview is ready! Preview URL: https://pr-183.comapeo-docs.pages.dev 📦 Content: From content branch (no script changes)
This preview will update automatically when you push new commits to this PR. Built with commit 8ba2aa8 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8ba2aa8214
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| SHA="${{ steps.content-lock.outputs.sha }}" | ||
| echo "📂 Checking out content at SHA ${SHA:0:8}..." | ||
| git checkout "$SHA" -- docs/ i18n/ static/images/ | ||
| git checkout "$SHA" -- docs/ i18n/ static/img/ |
There was a problem hiding this comment.
Restore generated image checkout path
For content-sourced production/test/staging deploys, this line means git checkout "$SHA" -- ... restores only static/img; git checkout -h documents this form as git checkout ... -- <file>..., so static/images is not copied. The Notion generator still writes downloaded assets to static/images (scripts/notion-fetch/imageProcessing.ts:175-176) and the publisher stages static/images (api-server/content-repo.ts:882-884), while static/img is preserved core Docusaurus assets (scripts/cleanup-generated-content.ts:16-17). Any docs containing generated /images/... references deploy without those files, causing broken images.
Useful? React with 👍 / 👎.
| fi | ||
| elif [ "$BRANCH_NAME" = "content" ]; then | ||
| if printf '%s\n' "$CHANGED_FILES" | grep -Eq '^(docs/|i18n/|static/images/)'; then | ||
| if printf '%s\n' "$CHANGED_FILES" | grep -Eq '^(docs/|i18n/|static/img/)'; then |
There was a problem hiding this comment.
Keep staging deploys triggered by generated images
For content-branch commits that only update an image under static/images/, staging will not run: the on.push.paths list above now has static/img/** but no static/images/**, and this changed-file gate also only matches static/img/. The content publisher stages generated images under static/images (api-server/content-repo.ts:882-884), so image-only content updates stay stale on staging.
Useful? React with 👍 / 👎.
Code Review by Qodo
Context used✅ Compliance rules (platform):
13 rules 1. Docs mention static/images/
|
| SHA="${{ steps.content-lock.outputs.sha }}" | ||
| echo "📂 Checking out content at SHA ${SHA:0:8}..." | ||
| git checkout "$SHA" -- docs/ i18n/ static/images/ | ||
| git checkout "$SHA" -- docs/ i18n/ static/img/ |
There was a problem hiding this comment.
1. git checkout uses static/img/ 📘 Rule violation ⌂ Architecture
The deploy workflows now check out and validate static/img/, but Compliance ID 342739 (and the content generation pipeline) expects images under static/images/ referenced via /images, creating a policy and pipeline mismatch that can ship deployments without generated images (broken links) and produce misleading image counters.
Agent Prompt
## Issue description
Deploy workflows were changed to check out/validate `static/img/`, but compliance requires images under `static/images/` referenced via `/images`, and the content generation pipeline still outputs to `static/images/` and rewrites Markdown to `/images/...`. This inconsistency can cause deployments to omit generated image assets (broken image links) and makes image validation/counters misleading.
## Issue Context
- Compliance ID 342739 mandates images be stored under `static/images/` and referenced via `/images`.
- Deploy workflows currently check out and count only `static/img/`.
- The Notion/content generator defaults to writing images into `static/images/` (unless `IMAGES_PATH` is overridden) and emits `/images/...` URLs.
- The repository also appears to have Docusaurus-style `/img/...` references (e.g., in config/manifest), indicating mixed conventions.
- Decide the canonical convention (either `static/images` + `/images` per compliance, or a deliberate migration to `static/img` + `/img`) and then make workflows, generator/env (`IMAGES_PATH`), and any references consistent.
## Fix Focus Areas
- .github/workflows/deploy-production.yml[127-180]
- .github/workflows/deploy-staging.yml[115-171]
- .github/workflows/deploy-test.yml[21-76]
- .github/workflows/deploy-pr-preview.yml[87-340]
- docusaurus.config.ts[257-257]
- static/manifest.json[15-74]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| SHA="${{ steps.content-lock.outputs.sha }}" | ||
| echo "📂 Checking out content at SHA ${SHA:0:8}..." | ||
| git checkout "$SHA" -- docs/ i18n/ static/images/ | ||
| git checkout "$SHA" -- docs/ i18n/ static/img/ |
There was a problem hiding this comment.
2. Docs mention static/images/ 📘 Rule violation ✧ Quality
Workflow documentation still instructs operators to check out/remove static/images/, but the workflows now use static/img/. This violates the requirement to update workflow docs when workflows change and may mislead deploy/rollback operations.
Agent Prompt
## Issue description
Workflow docs and runbooks reference `static/images/`, but deploy workflows now use `static/img/`.
## Issue Context
After this PR, operational docs become inaccurate (e.g., describing `git checkout ... static/images/`), which can cause confusion during deployments/rollbacks.
## Fix Focus Areas
- context/workflows/PRODUCTION_DEPLOYMENT.md[55-71]
- context/workflows/ROLLBACK.md[85-107]
- .github/workflows/deploy-production.yml[127-180]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| if [ ! -d "static/img" ] || [ -z "$(ls -A static/img 2>/dev/null)" ]; then | ||
| echo "⚠️ Warning: static/img/ directory is empty or missing" | ||
| fi | ||
|
|
||
| echo "✅ Content validated successfully" | ||
| echo "📊 Content statistics:" | ||
| echo " - English docs: $DOCS_COUNT" | ||
| echo " - Localized docs: $I18N_COUNT" | ||
| echo " - Total docs: $TOTAL_CONTENT" | ||
| find static/images -type f 2>/dev/null | wc -l | xargs echo " - Images:" | ||
| find static/img -type f 2>/dev/null | wc -l | xargs echo " - Images:" |
There was a problem hiding this comment.
3. Preview checks wrong image dir 🐞 Bug ◔ Observability
deploy-pr-preview.yml now warns/counts images under static/img, but when it regenerates content via bun run notion:fetch-all the generator writes images under static/images. This makes PR preview validation output report missing/0 images even when images were successfully generated.
Agent Prompt
## Issue description
PR preview content validation now checks `static/img/`, but the Notion regeneration path writes images into `static/images/` by default. This causes misleading warnings and image counts in preview runs.
## Issue Context
The PR preview workflow has two modes:
- checkout from content branch
- regenerate from Notion (`bun run notion:fetch-all`)
The regeneration mode does not set `IMAGES_PATH`, so the generator uses `static/images/`.
## Fix Focus Areas
- .github/workflows/deploy-pr-preview.yml[87-110]
- .github/workflows/deploy-pr-preview.yml[320-340]
## Implementation notes
- Easiest: change the warning and image count to consider both `static/img` and `static/images`.
- Alternative: if `static/img` is the new canonical directory, export `IMAGES_PATH=static/img` for the regeneration path and update generator logic accordingly (including `/images/...` vs `/img/...`).
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Merging this as-is would make the next production deploy's content checkout ( Corroborating: the content branch's own Decision (per #186, resolved with the repo owner): keep |
What
Deploy workflows checked out
docs/ i18n/ static/images/from the content branch, but image assets live atstatic/img/(tracked on bothmainandcontent).static/images/does not exist anywhere, so the checkout failed:This is why production and staging deploys have been failing since the last green run on 2026-03-09.
Files
deploy-production.yml— production died at content checkout (fatal)deploy-staging.yml— staging died the same way; trigger-decision grep (:76) andpathsfilter also referenced the wrong dirdeploy-test.yml— same unguarded hard-faildeploy-pr-preview.yml— guarded withif/elsefallback, so previews silently built without content-sourced imagesUpdates checkout pathspec, trigger-decision grep,
pathsfilter, and empty-dir guards/counters across all four.translate-docs.yml+.gitignorestill referencestatic/images/as part of content-branch gitignore management — left untouched to avoid disrupting the content sync mechanism.Verify
grep -rn "static/images" .github/workflows/deploy-*.yml→ noneprettier --checkon all four → unchanged (already formatted)python3 yaml.safe_loadon all four → valid YAMLNot in this PR (separate blocker)
content-lock.shaonmainpoints at a dead SHA (9849108…, wiped by a content-branch rebase). This is fixed by runningDeploy to Productionviaworkflow_dispatchafter this merges — it repromotesorigin/contentHEAD into the lock and deploys. Dispatch currently dies at the pathspec fixed here; once merged, it will succeed and rewrite the lock.Deploy steps (after merge)
gh workflow run deploy-production.yml(no inputs → usesorigin/contentHEAD89030f6)89030f6("translations-update: auto-translations") is approved production content firstgh run watchNotes
origin/main(8ab4159); localmainhas 3 unpushed commits (dep + Node 20 bumps) that are not included here and need separate approval to push.Greptile Summary
This PR fixes deploy workflows so content image assets are checked out from the existing
static/imgpath. The main changes are:static/img.static/img.static/imgfor content-branch image changes.Confidence Score: 5/5
Safe to merge with minimal risk.
Changes are narrow CI path corrections, and repository context confirms
static/imgexists whilestatic/imagesdoes not. No functional or security issues were identified in the changed workflows.No files require special attention.
What T-Rex did
Important Files Changed
static/imagestostatic/img; no issues found.static/img; no issues found.static/img; no issues found.static/img; no issues found.Sequence Diagram
%%{init: {'theme': 'neutral'}}%% sequenceDiagram participant Trigger as Workflow trigger participant Checkout as Actions checkout participant Content as content branch / locked SHA participant Build as Docusaurus build participant Deploy as Pages deploy Trigger->>Checkout: Start deploy workflow Checkout->>Content: Fetch content ref Content-->>Checkout: docs/, i18n/, static/img/ Checkout->>Build: Validate content and image assets Build->>Deploy: Upload/deploy built site%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% sequenceDiagram participant Trigger as Workflow trigger participant Checkout as Actions checkout participant Content as content branch / locked SHA participant Build as Docusaurus build participant Deploy as Pages deploy Trigger->>Checkout: Start deploy workflow Checkout->>Content: Fetch content ref Content-->>Checkout: docs/, i18n/, static/img/ Checkout->>Build: Validate content and image assets Build->>Deploy: Upload/deploy built siteReviews (1): Last reviewed commit: "fix(ci): use static/img pathspec in depl..." | Re-trigger Greptile