File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 : |
You can’t perform that action at this time.
0 commit comments