-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
121 lines (99 loc) Β· 3.56 KB
/
Copy pathdeploy-docs.yml
File metadata and controls
121 lines (99 loc) Β· 3.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
name: Deploy Documentation
on:
push:
branches: [ master ]
# Allow manual triggering
workflow_dispatch:
jobs:
deploy-docs:
runs-on: ubuntu-latest
# Only run on pushes to master (not PRs)
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'
- name: Install main dependencies
run: yarn install
- name: Build main library
run: |
grunt
webpack
npx tsc --project tsconfig.docs.json --stripInternal
- name: Install Angular dependencies
run: |
cd angular
yarn install
- name: Build Angular library
run: yarn build:ng
- name: Install React dependencies
run: cd react && npm install --legacy-peer-deps
- name: Install Vue dependencies
run: cd vue && npm install --legacy-peer-deps
- name: Generate all documentation
run: yarn doc
- name: Prepare deployment structure
run: |
mkdir -p deploy
# Create proper directory structure for GitHub Pages
mkdir -p deploy/doc/html
mkdir -p deploy/angular/doc/html
mkdir -p deploy/react/doc/html
mkdir -p deploy/vue/doc/html
# Debug: Check what was generated
echo "π Checking generated documentation..."
for lib in "Main:doc/html" "Angular:angular/doc/html" "React:react/doc/html" "Vue:vue/doc/html"; do
name="${lib%%:*}"
dir="${lib##*:}"
if [ -d "$dir" ]; then
echo " β $name: $dir/ exists ($(ls $dir | wc -l) files)"
else
echo " β $name: $dir/ NOT FOUND"
fi
done
# Copy main library HTML documentation
if [ -d "doc/html" ]; then
cp -r doc/html/* deploy/doc/html/
echo "β Copied main library HTML docs"
fi
# Copy Angular library HTML documentation
if [ -d "angular/doc/html" ]; then
cp -r angular/doc/html/* deploy/angular/doc/html/
echo "β Copied Angular library HTML docs"
fi
# Copy React library HTML documentation
if [ -d "react/doc/html" ]; then
cp -r react/doc/html/* deploy/react/doc/html/
echo "β Copied React library HTML docs"
fi
# Copy Vue library HTML documentation
if [ -d "vue/doc/html" ]; then
cp -r vue/doc/html/* deploy/vue/doc/html/
echo "β Copied Vue library HTML docs"
fi
# Ensure .nojekyll exists to prevent Jekyll processing
touch deploy/.nojekyll
# Final verification
echo ""
echo "π¦ Deployment structure (HTML files):"
find deploy -type f -name "*.html" | head -20
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./deploy
keep_files: true
commit_message: 'Deploy documentation from ${{ github.sha }}'
- name: Deployment completed
run: |
echo "β
Documentation deployment completed!"
echo "π Available at: https://gridstack.github.io/gridstack.js/"
echo " Angular: https://gridstack.github.io/gridstack.js/angular/doc/html/"
echo " React: https://gridstack.github.io/gridstack.js/react/doc/html/"
echo " Vue: https://gridstack.github.io/gridstack.js/vue/doc/html/"