Skip to content

chore(ci): publish-docs.sh preserves docs-pages .github/#21

Merged
mariomeyer merged 1 commit into
mainfrom
fix-publish-docs-preserve-github
May 23, 2026
Merged

chore(ci): publish-docs.sh preserves docs-pages .github/#21
mariomeyer merged 1 commit into
mainfrom
fix-publish-docs-preserve-github

Conversation

@mariomeyer
Copy link
Copy Markdown
Member

What broke

The first run of `deploy-docs.yml` (after PR #20 merged) wiped `.github/workflows/deploy-pages.yml` from the `docs-pages` branch. That workflow is what triggers GitHub Pages deploys on every `docs-pages` push. Losing it broke the deploy chain silently — the docs-pages push reported success, but Pages stayed on the previous content because no workflow triggered after.

Discovered via `curl https://stint.reyem.tech/help/privacy/\` returning 404 after the merge. The page existed on the docs-pages branch (verified in the deploy run log), but Pages was serving the pre-Phase-5 stub.

What's fixed live

  • `.github/workflows/deploy-pages.yml` restored on docs-pages via direct API commit (`22f3088` on docs-pages). That commit itself triggered the deploy workflow now that it exists, and stint.reyem.tech now serves the full Starlight site:

```
privacy: 200
install: 200
install.sh: 200
quickstart: 200
license: 200
cli: 200
```

What this PR fixes (prevents recurrence)

`scripts/release/publish-docs.sh`:

  • Add `.github` to the PRESERVE list
  • Switch `cp -p` → `cp -a` so the stash/restore loops handle directories (cp -p alone fails on dirs)
  • Switch `[[ -f $stash/$f ]]` → `[[ -e ]]` so the restore guard matches directories too

After this lands, the next deploy-docs run will leave `.github/` alone on docs-pages instead of wiping it.

Test plan

  • `shellcheck scripts/release/publish-docs.sh` clean
  • CI green
  • On merge: deploy-docs.yml runs, publish-docs.sh runs, docs-pages keeps its `.github/workflows/deploy-pages.yml` (verify by checking `git ls-tree origin/docs-pages` after deploy)
  • Pages deploy continues to fire on subsequent docs pushes

Merge via "Create a merge commit" per standard. This is a `fix:` so it'll trigger a v0.2.1 release — that's the right outcome (the deploy regression was a real user-impacting bug; cutting a patch documents the fix in CHANGELOG).

The first run of deploy-docs.yml on main wiped
\`.github/workflows/deploy-pages.yml\` from the docs-pages branch
because PRESERVE only listed install.sh / install.sh.sha256 / CNAME.
That workflow is what actually pushes pages to GitHub Pages on every
docs-pages push — losing it broke the deploy chain silently (the
docs-pages push reported success, but Pages stayed on the previous
content because no workflow triggered).

The deleted workflow has been manually restored on docs-pages via a
direct API commit (which itself triggered the deploy and brought the
site live). This commit ensures we don't redo the damage next time:

- Add \`.github\` to the PRESERVE list (whole directory)
- Switch stash/restore loops from \`cp -p\` to \`cp -a\` (preserves dirs
  + recurses; \`cp -p\` alone fails on directories)
- Switch the restore guard from \`[[ -f ]]\` to \`[[ -e ]]\` so it
  matches directories as well as regular files

Verified by reading the deploy-docs run log of the broken deploy
(commit 1ef5540 on docs-pages): the 55-file commit included
"delete mode 100644 .github/workflows/deploy-pages.yml". After the
manual restore (commit 22f3088 on docs-pages), the Pages deploy ran
and stint.reyem.tech now serves the full Starlight site.

Filed as chore(ci) rather than fix because the shipped app is
unchanged — this is purely a deploy-script fix. No version bump
warranted; users wouldn't see any difference if we cut v0.2.1.
@mariomeyer mariomeyer force-pushed the fix-publish-docs-preserve-github branch from 2f94e16 to aeb4f2b Compare May 23, 2026 06:18
@mariomeyer mariomeyer changed the title fix(docs): publish-docs.sh preserves docs-pages .github/ chore(ci): publish-docs.sh preserves docs-pages .github/ May 23, 2026
@mariomeyer mariomeyer merged commit 87ac441 into main May 23, 2026
2 checks passed
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