Skip to content

Commit 45baea9

Browse files
committed
fix: clean up stale root-level files on gh-pages deployment
Removes old files from when book was deployed at root: - contents/, assets/, site_libs/, tools/ - _redirects, netlify.toml, search.json, sitemap.xml, etc. This fixes the /kits redirect issue caused by stale _redirects file.
1 parent 23c70fe commit 45baea9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

.github/workflows/book-publish-live.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,6 +1031,12 @@ jobs:
10311031
echo "🗑️ Clearing existing book/ directory..."
10321032
rm -rf book/
10331033
1034+
# Clean up stale root-level files from old deployment structure
1035+
echo "🧹 Removing stale root-level files..."
1036+
rm -rf contents/ assets/ site_libs/ tools/
1037+
rm -f _redirects netlify.toml search.json sitemap.xml site.webmanifest 404.html
1038+
echo "✅ Stale files removed"
1039+
10341040
# Create book directory and copy new content
10351041
echo "📦 Deploying textbook to /book/..."
10361042
mkdir -p book

0 commit comments

Comments
 (0)