-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Merged
more web doc updates #3123
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
95 changes: 95 additions & 0 deletions
.github/workflows/build-docs.yml
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
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
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
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!" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,8 @@ dist_save | |
*.zip | ||
angular/ | ||
react/ | ||
.DS_Store | ||
doc/.DS_Store | ||
|
||
!node_modules/ | ||
node_modules/* | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions
.../html/classes/base-widget.BaseWidget.html → .../html/classes/base-widget.BaseWidget.html
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.