-
Notifications
You must be signed in to change notification settings - Fork 3
148 lines (123 loc) · 4.52 KB
/
documentation-generation.yml
File metadata and controls
148 lines (123 loc) · 4.52 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: Documentation Generation
on:
push:
branches:
- main
permissions:
contents: read
pages: write
id-token: write
jobs:
test-docs-generation:
runs-on: ubuntu-latest
environment:
name: github-pages-test
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true
- name: Install dependencies
run: npm ci
- name: Set branch type based on trigger
id: set-branch
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "BRANCH_TYPE=${{ github.event.inputs.branch_type }}" >> $GITHUB_ENV
else
echo "BRANCH_TYPE=main" >> $GITHUB_ENV
fi
echo "VERSION=1.2.3" >> $GITHUB_ENV
- name: Generate documentation
run: |
mkdir -p .github/scripts/docs
bash .github/scripts/docs/generate-and-publish-docs.sh "$BRANCH_TYPE" "$VERSION"
- name: Create Jekyll source directory
run: |
# Create Jekyll source directory
mkdir -p site-src
# First, copy all docs to site-src
cp -r docs/* site-src/
- name: Generate schema documentation
run: |
echo "🔄 Generating schema documentation..."
node scripts/generate-schema-docs.js
- name: Process schema documentation and prepare for Jekyll
run: |
echo "🔄 Processing documentation files..."
cd site-src
chmod +x ../.github/scripts/docs/process-docs.sh
../.github/scripts/docs/process-docs.sh
cd ..
- name: Fix documentation links
run: |
echo "🔄 Fixing documentation links..."
cd site-src
chmod +x ../.github/scripts/docs/fix-schema-links.sh
../.github/scripts/docs/fix-schema-links.sh
cd ..
- name: Fix Liquid templates and create lowercase files
run: |
echo "🔄 Fixing Liquid templates and creating lowercase files..."
cd site-src
chmod +x ../.github/scripts/docs/fix-docs.sh
../.github/scripts/docs/fix-docs.sh
cd ..
- name: Create Jekyll configuration
run: |
echo "🔄 Creating Jekyll configuration files..."
chmod +x .github/scripts/docs/create-jekyll-config.sh
.github/scripts/docs/create-jekyll-config.sh
- name: Build and verify Jekyll site
run: |
# Build the site
echo "🔨 Building Jekyll site..."
cd site-src
bundle install
JEKYLL_ENV=production bundle exec jekyll build --destination ../_site
cd ..
# Verification steps
echo "🔍 Verifying build results..."
# Show root files explicitly
echo "📄 Files at site root:"
ls -la _site/
# Check for HTML files
echo "✓ HTML files generated from markdown:"
find _site -name "*.html" | grep -v "assets" | head -n 15
html_count=$(find _site -name "*.html" | wc -l)
echo " Total HTML files: $html_count"
# Check if any markdown files remain in output (there shouldn't be any)
md_files=$(find _site -name "*.md" | wc -l)
if [ "$md_files" -gt 0 ]; then
echo "⚠️ WARNING: Found $md_files markdown files in output (should be 0):"
find _site -name "*.md" | head -n 10
else
echo "✅ No markdown files found in output (good!)"
fi
# Check for specific problematic files to make sure they were converted
for check_file in "features/configuration-based/PAGE_TEMPLATES.html" "features/configuration-based/PAGE_EVENTS.html" "features/code-based/PAGE_VIEWS.html"; do
if [ -f "_site/$check_file" ]; then
echo "✅ Successfully converted: $check_file"
else
echo "❌ FAILED to convert: $check_file"
fi
done
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v4
with:
path: '_site'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
with:
timeout: 600000 # 10 minutes in milliseconds