Skip to content

fix: keep .nojekyll and CNAME on redeploy (release 3.1.2) - #217

Merged
JohannesHoppe merged 3 commits into
mainfrom
fix/keep-nojekyll-on-redeploy
Oct 9, 2026
Merged

JohannesHoppe merged 3 commits into
mainfrom
fix/keep-nojekyll-on-redeploy

Conversation

@JohannesHoppe

Copy link
Copy Markdown
Member

Since 3.0.3, a second deploy removes .nojekyll from the gh-pages branch, so GitHub Pages runs Jekyll again (files and folders starting with _ disappear).

Cause: the cleanup hook from #207 removes every tracked file that is not in dist. gh-pages writes .nojekyll and CNAME into its clone, not into dist. CNAME survived only because gh-pages' own remove step unstages non-dot files first.

Fix: the hook keeps the files gh-pages generates for the active options. A leftover .nojekyll is still removed when --no-nojekyll is set.

Tests:

  • integration test: two deploys keep .nojekyll and CNAME (fails without the fix)
  • integration test: disabling nojekyll removes a leftover .nojekyll
  • CI: every Angular version (18–22) deploys twice and checks for .nojekyll

Bumps the version to 3.1.2.

The cleanup hook from #207 removes every tracked file that is not in dist. gh-pages writes .nojekyll and CNAME into its clone, not into dist, so a redeploy removed the .nojekyll that gh-pages had just created and GitHub Pages ran Jekyll again. CNAME survived only because gh-pages' own remove step unstages non-dot files first.

The hook now keeps the files gh-pages generates for the active options. A leftover .nojekyll is still removed when nojekyll is disabled. CI deploys every Angular version twice and checks for .nojekyll.
- CI checks the exact file name (git cat-file -e) and asserts that the second deploy created a commit
- generatedFiles is a required parameter of createCleanupBeforeAddHook
- unit tests for the hook with a mocked git
- comments describe the current behaviour
@JohannesHoppe
JohannesHoppe merged commit bd50c37 into main Oct 9, 2026
2 checks passed
@JohannesHoppe
JohannesHoppe deleted the fix/keep-nojekyll-on-redeploy branch October 9, 2026 20:54
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