DDDraggable fix to querySelectorAll(handle) for nested grid #22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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!" |