Skip to content

Commit bdb5653

Browse files
committed
fix gh-pages doc deploy
1 parent f292def commit bdb5653

2 files changed

Lines changed: 64 additions & 29 deletions

File tree

.github/workflows/deploy-docs.yml

Lines changed: 39 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -52,40 +52,59 @@ jobs:
5252
mkdir -p deploy/doc/html
5353
mkdir -p deploy/angular/doc/html
5454
55+
# Debug: Check what was generated
56+
echo "📁 Checking generated documentation..."
57+
echo "Main library HTML docs:"
58+
if [ -d "doc/html" ]; then
59+
echo " ✓ doc/html/ exists"
60+
ls -la doc/html/ | head -10
61+
else
62+
echo " ✗ doc/html/ NOT FOUND"
63+
fi
64+
65+
echo "Angular library HTML docs:"
66+
if [ -d "angular/doc/html" ]; then
67+
echo " ✓ angular/doc/html/ exists"
68+
ls -la angular/doc/html/ | head -10
69+
else
70+
echo " ✗ angular/doc/html/ NOT FOUND"
71+
fi
72+
73+
echo "Angular library Markdown docs (should NOT be deployed):"
74+
if [ -d "angular/doc/api" ]; then
75+
echo " ⚠ angular/doc/api/ exists (will NOT be copied to deployment)"
76+
ls -la angular/doc/api/ | head -10
77+
else
78+
echo " ✓ angular/doc/api/ does not exist"
79+
fi
80+
5581
# Copy main library HTML documentation
5682
if [ -d "doc/html" ]; then
5783
cp -r doc/html/* deploy/doc/html/
84+
echo "✓ Copied main library HTML docs"
85+
else
86+
echo "⚠ Warning: Main library HTML docs not found, skipping..."
5887
fi
5988
6089
# Copy Angular library HTML documentation
6190
if [ -d "angular/doc/html" ]; then
6291
cp -r angular/doc/html/* deploy/angular/doc/html/
92+
echo "✓ Copied Angular library HTML docs"
93+
else
94+
echo "⚠ Warning: Angular library HTML docs not found, skipping..."
6395
fi
6496
65-
# Copy redirect index.html to root
66-
if [ -f "doc/index.html" ]; then
67-
cp doc/index.html deploy/
68-
fi
97+
# Note: Do NOT copy or create index.html at root
98+
# The gh-pages branch has its own index.html that should be preserved
99+
# The keep_files: true option will preserve existing files on gh-pages
69100
70101
# Ensure .nojekyll exists to prevent Jekyll processing
71102
touch deploy/.nojekyll
72103
73-
# Optional: Add a simple index.html at root if none exists
74-
if [ ! -f "deploy/index.html" ]; then
75-
cat > deploy/index.html << 'EOF'
76-
<!DOCTYPE html>
77-
<html>
78-
<head>
79-
<title>GridStack.js Documentation</title>
80-
<meta http-equiv="refresh" content="0; url=./doc/html/">
81-
</head>
82-
<body>
83-
<h1>GridStack.js Documentation</h1>
84-
<p>Redirecting to <a href="./doc/html/">API Documentation</a>...</p>
85-
</body>
86-
</html>
87-
EOF
88-
fi
104+
# Final verification
105+
echo ""
106+
echo "📦 Deployment structure:"
107+
find deploy -type f -name "*.html" | head -20
89108
90109
- name: Deploy to GitHub Pages
91110
uses: peaceiris/actions-gh-pages@v4

.github/workflows/sync-docs.yml

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,32 @@ jobs:
3030
- name: Check if docs exist
3131
id: check-docs
3232
run: |
33+
echo "🔍 Checking for documentation directories on master branch..."
34+
3335
if [ -d "doc/html" ]; then
36+
echo " ✓ doc/html/ exists"
3437
echo "main_docs=true" >> $GITHUB_OUTPUT
3538
else
39+
echo " ✗ doc/html/ NOT FOUND"
3640
echo "main_docs=false" >> $GITHUB_OUTPUT
3741
fi
3842
39-
if [ -d "angular/doc/api" ]; then
43+
if [ -d "angular/doc/html" ]; then
44+
echo " ✓ angular/doc/html/ exists"
4045
echo "angular_docs=true" >> $GITHUB_OUTPUT
4146
else
47+
echo " ✗ angular/doc/html/ NOT FOUND"
4248
echo "angular_docs=false" >> $GITHUB_OUTPUT
4349
fi
50+
51+
if [ -d "angular/doc/api" ]; then
52+
echo " ℹ angular/doc/api/ exists (Markdown - will NOT be synced)"
53+
fi
54+
55+
echo ""
56+
echo "Sync decisions:"
57+
echo " Main library HTML: $([ -d 'doc/html' ] && echo 'YES' || echo 'NO')"
58+
echo " Angular library HTML: $([ -d 'angular/doc/html' ] && echo 'YES' || echo 'NO')"
4459
4560
- name: Checkout gh-pages branch
4661
if: steps.check-docs.outputs.main_docs == 'true' || steps.check-docs.outputs.angular_docs == 'true'
@@ -70,16 +85,17 @@ jobs:
7085
run: |
7186
echo "Syncing Angular library documentation..."
7287
73-
# Remove existing Angular docs if they exist
74-
if [ -d "angular/doc" ]; then
75-
rm -rf angular/doc
88+
# Remove existing Angular HTML docs if they exist
89+
if [ -d "angular/doc/html" ]; then
90+
rm -rf angular/doc/html
7691
fi
7792
78-
# Extract Angular docs from master branch using git archive
79-
git archive master angular/doc | tar -xf -
93+
# Extract Angular HTML docs from master branch using git archive
94+
mkdir -p angular/doc
95+
git archive master angular/doc/html | tar -xf -
8096
8197
# Add changes
82-
git add -f angular/doc
98+
git add -f angular/doc/html
8399
84100
- name: Commit and push changes
85101
if: steps.check-docs.outputs.main_docs == 'true' || steps.check-docs.outputs.angular_docs == 'true'
@@ -93,10 +109,10 @@ jobs:
93109
# Create commit message
94110
COMMIT_MSG="📚 Auto-sync documentation from master"
95111
if [ "${{ steps.check-docs.outputs.main_docs }}" == "true" ]; then
96-
COMMIT_MSG="${COMMIT_MSG}%0A%0A- Updated main library HTML docs (docs/html/)"
112+
COMMIT_MSG="${COMMIT_MSG}%0A%0A- Updated main library HTML docs (doc/html/)"
97113
fi
98114
if [ "${{ steps.check-docs.outputs.angular_docs }}" == "true" ]; then
99-
COMMIT_MSG="${COMMIT_MSG}%0A%0A- Updated Angular library docs (angular/doc/)"
115+
COMMIT_MSG="${COMMIT_MSG}%0A%0A- Updated Angular library HTML docs (angular/doc/html/)"
100116
fi
101117
102118
COMMIT_MSG="${COMMIT_MSG}%0A%0ASource: ${{ github.sha }}"

0 commit comments

Comments
 (0)