Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

more web doc updates #3123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
adumesny merged 3 commits into gridstack:gh-pages from adumesny:gh-pages
Aug 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 95 additions & 0 deletions .github/workflows/build-docs.yml
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: Build and Update Documentation

on:
push:
branches: [master, develop]
paths:
- 'src/**'
- 'angular/projects/lib/**'
- 'typedoc*.json'
- 'package.json'
- 'scripts/generate-docs.js'
- 'scripts/reorder-*.js'
pull_request:
branches: [master, develop]
paths:
- 'src/**'
- 'angular/projects/lib/**'
- 'typedoc*.json'
workflow_dispatch:

jobs:
build-docs:
runs-on: ubuntu-latest
if: github.repository == 'gridstack/gridstack.js'

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'yarn'

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Install Angular dependencies
run: |
cd angular
yarn install --frozen-lockfile

- name: Build TypeScript
run: |
yarn t

- name: Generate documentation
run: |
yarn doc:all

- name: Configure Git
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'

- name: Commit updated documentation
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: |
# Check if there are changes to the documentation
if git diff --quiet doc/ angular/doc/; then
echo "No documentation changes to commit"
exit 0
fi

# Add documentation changes
git add doc/ angular/doc/

# Create commit message
COMMIT_MSG="📚 Auto-update documentation

Generated from latest source code changes
- Updated TypeDoc HTML documentation
- Updated API documentation

Source: ${{ github.sha }}"

# Commit changes
git commit -m "$COMMIT_MSG"
git push origin master

echo "✅ Documentation updated and committed to master!"

- name: Upload documentation artifacts
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v4
with:
name: documentation-preview
path: |
doc/html/
angular/doc/html/
retention-days: 7
118 changes: 118 additions & 0 deletions .github/workflows/sync-docs.yml
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
name: Sync Documentation to gh-pages

on:
push:
branches: [master, develop]
paths:
- 'doc/html/**'
- 'angular/doc/html/**'
- '.github/workflows/sync-docs.yml'
workflow_dispatch:

jobs:
sync-docs:
runs-on: ubuntu-latest
if: github.repository == 'gridstack/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: |
if [ -d "doc/html" ]; then
echo "main_docs=true" >> $GITHUB_OUTPUT
else
echo "main_docs=false" >> $GITHUB_OUTPUT
fi

if [ -d "angular/doc/html" ]; then
echo "angular_docs=true" >> $GITHUB_OUTPUT
else
echo "angular_docs=false" >> $GITHUB_OUTPUT
fi

- 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 docs directory if it exists
if [ -d "docs/html" ]; then
rm -rf docs/html
fi

# Copy from master branch
git checkout master -- doc/html

# Move to the correct location for gh-pages
mkdir -p docs
mv doc/html docs/html
rm -rf doc

# Add changes
git add docs/html

- name: Sync Angular documentation
if: steps.check-docs.outputs.angular_docs == 'true'
run: |
echo "Syncing Angular library documentation..."

# Remove existing Angular docs if they exist
if [ -d "angular/doc/html" ]; then
rm -rf angular/doc/html
fi

# Copy from master branch
git checkout master -- angular/doc/html

# Add changes
git add 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

- Updated main library HTML docs (docs/html/)"
fi
if [ "${{ steps.check-docs.outputs.angular_docs }}" == "true" ]; then
COMMIT_MSG="$COMMIT_MSG

- Updated Angular library HTML docs (angular/doc/html/)"
fi

COMMIT_MSG="$COMMIT_MSG

Source: ${{ github.sha }}"

# Commit and push
git commit -m "$COMMIT_MSG"
git push origin gh-pages

echo "✅ Documentation synced to gh-pages successfully!"
2 changes: 2 additions & 0 deletions .gitignore
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ dist_save
*.zip
angular/
react/
.DS_Store
doc/.DS_Store

!node_modules/
node_modules/*
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.

Large diffs are not rendered by default.

Loading

AltStyle によって変換されたページ (->オリジナル) /