-
Notifications
You must be signed in to change notification settings - Fork 0
169 lines (141 loc) · 6.34 KB
/
pages.yml
File metadata and controls
169 lines (141 loc) · 6.34 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
name: Deploy Documentation to GitHub Pages
on:
push:
branches:
- main
paths:
- 'docs_site/**'
- 'GUIDES/**'
- 'README.md'
- '.github/workflows/pages.yml'
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN || secrets.PAGES_TOKEN || github.token }}
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1'
bundler-cache: true
working-directory: ./docs_site
- name: Setup Pages
uses: actions/configure-pages@v4
continue-on-error: true
- name: Build Jekyll site
working-directory: ./docs_site
env:
JEKYLL_ENV: production
run: |
set -e
REPO_NAME=$(echo ${{ github.repository }} | cut -d'/' -f2)
CURRENT_YEAR=$(date +%Y)
echo "🔨 Building Jekyll site with baseurl: /$REPO_NAME"
# Build Jekyll site (generates index.html from index.md)
# Suppress Sass deprecation warnings (they're harmless)
bundle exec jekyll build --baseurl "/$REPO_NAME" 2>&1 | grep -v "DEPRECATION WARNING" || true
# Verify build completed and index.html was generated
if [ ! -f "_site/index.html" ]; then
echo "❌ Build failed: index.html not generated in _site/"
exit 1
fi
echo "✅ Jekyll build complete: _site/index.html generated"
# Verify Mermaid.js is included in the layout
if grep -q "mermaid" _site/architecture.html 2>/dev/null; then
echo "✅ Mermaid.js script found in architecture.html"
else
echo "⚠️ Warning: Mermaid.js script not found in architecture.html"
fi
# Count Mermaid diagram blocks in source
MERMAID_COUNT=$(grep -c '```mermaid' architecture.md 2>/dev/null || echo "0")
echo "📊 Found $MERMAID_COUNT Mermaid diagram blocks in architecture.md"
# Verify Mermaid code blocks are in HTML output
MERMAID_HTML_COUNT=$(grep -c 'language-mermaid\|class="language-mermaid"' _site/architecture.html 2>/dev/null || echo "0")
echo "📊 Found $MERMAID_HTML_COUNT Mermaid code blocks in architecture.html"
if [ "$MERMAID_HTML_COUNT" = "0" ] && [ "$MERMAID_COUNT" != "0" ]; then
echo "⚠️ Warning: Mermaid diagrams in markdown but not found in HTML output"
echo " This may indicate a markdown processing issue"
fi
# Verify key pages were built
for page in index.html architecture.html getting_started.html; do
if [ -f "_site/$page" ]; then
echo "✅ Page built: $page"
else
echo "⚠️ Warning: Page not found: $page"
fi
done
- name: Prepare artifact
run: |
set -e
REPO_NAME=$(echo ${{ github.repository }} | cut -d'/' -f2)
echo "📦 Preparing artifact for deployment..."
# Create artifact structure at root: $REPO_NAME/
mkdir -p $REPO_NAME
# Copy all built files from docs_site/_site/ to root $REPO_NAME/
cp -r docs_site/_site/* $REPO_NAME/ 2>/dev/null || true
# Verify index.html was copied successfully
if [ ! -f "$REPO_NAME/index.html" ]; then
echo "❌ Copy failed: index.html not found in $REPO_NAME/"
exit 1
fi
# Verify architecture page with diagrams was copied
if [ -f "$REPO_NAME/architecture.html" ]; then
echo "✅ Architecture page copied: $REPO_NAME/architecture.html"
# Check file size (should be substantial if diagrams are included)
FILE_SIZE=$(wc -c < "$REPO_NAME/architecture.html")
echo " File size: $FILE_SIZE bytes"
else
echo "⚠️ Warning: architecture.html not found in artifact"
fi
# Count total HTML files
HTML_COUNT=$(find $REPO_NAME -name "*.html" | wc -l)
echo "📄 Total HTML files in artifact: $HTML_COUNT"
echo "✅ Artifact prepared: $REPO_NAME/index.html ready for deployment"
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ${{ github.event.repository.name }}
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
continue-on-error: true
- name: Deployment info
if: success()
run: |
REPO_NAME=$(echo ${{ github.repository }} | cut -d'/' -f2)
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "✅ Deployment successful!"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
echo "📄 Documentation Site:"
echo " https://${{ github.repository_owner }}.github.io/$REPO_NAME/"
echo ""
echo "📊 Architecture Page (with diagrams):"
echo " https://${{ github.repository_owner }}.github.io/$REPO_NAME/architecture.html"
echo ""
echo "⏱️ Wait 1-2 minutes for propagation, then clear cache if needed."
echo ""
echo "💡 Mermaid diagrams will render automatically via client-side JavaScript"
echo ""
- name: Check deployment status
if: failure()
run: |
REPO_NAME=$(echo ${{ github.repository }} | cut -d'/' -f2)
echo "::warning::Deployment failed. Enable GitHub Pages: Settings → Pages → Source: GitHub Actions"
echo "Expected URL: https://${{ github.repository_owner }}.github.io/$REPO_NAME/"
exit 1