Skip to content

Commit 8e15fc9

Browse files
authored
Merge pull request #3221 from adumesny/master
more gh-pages doc fixes
2 parents be3d42f + 2d2dc6b commit 8e15fc9

1 file changed

Lines changed: 20 additions & 1 deletion

File tree

.github/workflows/deploy-docs.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,30 @@ jobs:
105105
echo ""
106106
echo "📦 Deployment structure:"
107107
find deploy -type f -name "*.html" | head -20
108+
109+
- name: Preserve gh-pages root index.html
110+
run: |
111+
# Fetch gh-pages to get existing index.html if we didn't create one
112+
if [ ! -f "deploy/index.html" ]; then
113+
echo "📄 No index.html in deploy, fetching from gh-pages..."
114+
git fetch origin gh-pages:gh-pages 2>/dev/null || true
115+
116+
# Check out just the index.html from gh-pages if it exists
117+
if git show origin/gh-pages:index.html > /dev/null 2>&1; then
118+
git show origin/gh-pages:index.html > deploy/index.html
119+
echo "✓ Preserved existing index.html from gh-pages"
120+
else
121+
echo "ℹ No index.html on gh-pages to preserve"
122+
fi
123+
else
124+
echo "ℹ index.html already in deploy directory, not fetching from gh-pages"
125+
fi
108126
109127
- name: Deploy to GitHub Pages
110128
uses: peaceiris/actions-gh-pages@v4
111129
with:
112130
github_token: ${{ secrets.GITHUB_TOKEN }}
113131
publish_dir: ./deploy
114-
keep_files: true
132+
# Clean deployment each time to avoid stale files
133+
keep_files: false
115134
commit_message: 'Deploy documentation from ${{ github.sha }}'

0 commit comments

Comments
 (0)