Skip to content

DDDraggable fix to querySelectorAll(handle) for nested grid #22

DDDraggable fix to querySelectorAll(handle) for nested grid

DDDraggable fix to querySelectorAll(handle) for nested grid #22

Workflow file for this run

name: Sync Documentation to gh-pages
on:
push:
branches: [master, develop]
paths:
- 'doc/html/**'
- 'angular/doc/**'
- '.github/workflows/sync-docs.yml'
workflow_dispatch:
jobs:
sync-docs:
runs-on: ubuntu-latest
if: github.repository == 'adumesny/gridstack.js'
steps:
- name: Checkout master branch
uses: actions/checkout@v4
with:
ref: master
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Configure Git
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: Check if docs exist
id: check-docs
run: |
echo "πŸ” Checking for documentation directories on master branch..."
if [ -d "doc/html" ]; then
echo " βœ“ doc/html/ exists"
echo "main_docs=true" >> $GITHUB_OUTPUT
else
echo " βœ— doc/html/ NOT FOUND"
echo "main_docs=false" >> $GITHUB_OUTPUT
fi
if [ -d "angular/doc/html" ]; then
echo " βœ“ angular/doc/html/ exists"
echo "angular_docs=true" >> $GITHUB_OUTPUT
else
echo " βœ— angular/doc/html/ NOT FOUND"
echo "angular_docs=false" >> $GITHUB_OUTPUT
fi
if [ -d "angular/doc/api" ]; then
echo " β„Ή angular/doc/api/ exists (Markdown - will NOT be synced)"
fi
echo ""
echo "Sync decisions:"
echo " Main library HTML: $([ -d 'doc/html' ] && echo 'YES' || echo 'NO')"
echo " Angular library HTML: $([ -d 'angular/doc/html' ] && echo 'YES' || echo 'NO')"
- name: Checkout gh-pages branch
if: steps.check-docs.outputs.main_docs == 'true' || steps.check-docs.outputs.angular_docs == 'true'
run: |
git fetch origin gh-pages
git checkout gh-pages
- name: Sync main library documentation
if: steps.check-docs.outputs.main_docs == 'true'
run: |
echo "Syncing main library documentation..."
# Remove existing doc/html directory if it exists
if [ -d "doc/html" ]; then
rm -rf doc/html
fi
# Extract docs from master branch using git archive
mkdir -p doc
git archive master doc/html | tar -xf -
# Add changes
git add doc/html
- name: Sync Angular documentation
if: steps.check-docs.outputs.angular_docs == 'true'
run: |
echo "Syncing Angular library documentation..."
# Remove existing Angular HTML docs if they exist
if [ -d "angular/doc/html" ]; then
rm -rf angular/doc/html
fi
# Extract Angular HTML docs from master branch using git archive
mkdir -p angular/doc
git archive master angular/doc/html | tar -xf -
# Add changes
git add -f angular/doc/html
- name: Commit and push changes
if: steps.check-docs.outputs.main_docs == 'true' || steps.check-docs.outputs.angular_docs == 'true'
run: |
# Check if there are changes to commit
if git diff --staged --quiet; then
echo "No documentation changes to sync"
exit 0
fi
# Create commit message
COMMIT_MSG="πŸ“š Auto-sync documentation from master"
if [ "${{ steps.check-docs.outputs.main_docs }}" == "true" ]; then
COMMIT_MSG="${COMMIT_MSG}%0A%0A- Updated main library HTML docs (doc/html/)"
fi
if [ "${{ steps.check-docs.outputs.angular_docs }}" == "true" ]; then
COMMIT_MSG="${COMMIT_MSG}%0A%0A- Updated Angular library HTML docs (angular/doc/html/)"
fi
COMMIT_MSG="${COMMIT_MSG}%0A%0ASource: ${{ github.sha }}"
# Decode URL-encoded newlines for the commit message
COMMIT_MSG=$(echo -e "${COMMIT_MSG//%0A/\\n}")
# Commit and push
git commit -m "$COMMIT_MSG"
git push origin gh-pages
echo "βœ… Documentation synced to gh-pages successfully!"