Skip to content

Commit 871c03e

Browse files
committed
fix: improve gh-pages deployment file handling with proper glob expansion
1 parent 49d7d0c commit 871c03e

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

.github/workflows/main.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,19 @@ jobs:
131131

132132
- name: Clear gh-pages and copy new site
133133
run: |
134-
# Remove everything except .git
135-
find . -maxdepth 1 ! -name '.git' ! -name '.' ! -name '..' -exec rm -rf {} +
134+
# Remove everything except .git and _temp_site
135+
find . -maxdepth 1 ! -name '.git' ! -name '.' ! -name '..' ! -name '_temp_site' -exec rm -rf {} +
136136
137-
# Copy new site
138-
cp -r _temp_site/* .
139-
rm -rf _temp_site
137+
# Copy new site (use shopt to include hidden files)
138+
shopt -s dotglob nullglob
139+
if [ -d "_temp_site" ] && [ "$(ls -A _temp_site)" ]; then
140+
mv _temp_site/* .
141+
rmdir _temp_site
142+
else
143+
echo "❌ _temp_site is empty or doesn't exist"
144+
ls -la _temp_site || echo "Directory doesn't exist"
145+
exit 1
146+
fi
140147
141148
- name: Commit and push
142149
run: |

0 commit comments

Comments
 (0)