@@ -15,35 +15,72 @@ jobs:
1515 deploy :
1616 name : Deploy to Cloudflare Pages and Update Notion
1717 runs-on : ubuntu-latest
18-
18+
1919 steps :
20- - name : Checkout code
20+ - name : Checkout code (main branch)
2121 uses : actions/checkout@v4
22-
22+ with :
23+ ref : main
24+
25+ - name : Checkout content files from content branch
26+ run : |
27+ set -e # Exit on error
28+
29+ echo "📥 Fetching content from content branch..."
30+ git fetch origin content
31+
32+ echo "📂 Checking out content files..."
33+ git checkout origin/content -- docs/ i18n/ static/images/
34+
35+ # Validate content exists
36+ echo "🔍 Validating content..."
37+
38+ if [ ! -d "docs" ] || [ -z "$(ls -A docs 2>/dev/null)" ]; then
39+ echo "❌ Error: docs/ directory is empty or missing"
40+ echo "Cannot proceed with build - documentation content is required"
41+ exit 1
42+ fi
43+
44+ if [ ! -d "i18n" ] || [ -z "$(ls -A i18n 2>/dev/null)" ]; then
45+ echo "⚠️ Warning: i18n/ directory is empty or missing"
46+ echo "Build will proceed but translations may be unavailable"
47+ fi
48+
49+ if [ ! -d "static/images" ] || [ -z "$(ls -A static/images 2>/dev/null)" ]; then
50+ echo "⚠️ Warning: static/images/ directory is empty or missing"
51+ echo "Build will proceed but images may be unavailable"
52+ fi
53+
54+ echo "✅ Content validation successful"
55+ echo "📊 Content statistics:"
56+ find docs -name "*.md" -type f 2>/dev/null | wc -l | xargs echo " - English docs:"
57+ find i18n -name "*.md" -type f 2>/dev/null | wc -l | xargs echo " - Localized docs:"
58+ find static/images -type f 2>/dev/null | wc -l | xargs echo " - Images:"
59+
2360 - name : Setup Bun
2461 uses : oven-sh/setup-bun@v2
2562 with :
2663 bun-version : latest
27-
64+
2865 - name : Install dependencies
2966 run : bun install
30-
67+
3168 - name : Build documentation
3269 run : bun run build
33-
70+
3471 - name : Deploy to Cloudflare Pages
3572 uses : cloudflare/wrangler-action@v3
3673 with :
3774 apiToken : ${{ secrets.CLOUDFLARE_API_TOKEN }}
3875 accountId : ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
3976 command : pages deploy build --project-name comapeo-docs --compatibility-date 2024-01-01
40-
77+
4178 - name : Update Notion status to Published
4279 run : bun run notionStatus:publish-production
4380 env :
4481 NOTION_API_KEY : ${{ secrets.NOTION_API_KEY }}
4582 DATABASE_ID : ${{ secrets.DATABASE_ID }}
46-
83+
4784 - name : Deployment summary
4885 run : |
4986 echo "🚀 **Production Deployment Complete!**" >> $GITHUB_STEP_SUMMARY
5390 echo "- ✅ Notion status updated: Staging → Published" >> $GITHUB_STEP_SUMMARY
5491 echo "- 📅 Published date set to $(date -u +%Y-%m-%d)" >> $GITHUB_STEP_SUMMARY
5592 echo "" >> $GITHUB_STEP_SUMMARY
56- echo "🌐 Site available at: https://docs.comapeo.app" >> $GITHUB_STEP_SUMMARY
93+ echo "🌐 Site available at: https://docs.comapeo.app" >> $GITHUB_STEP_SUMMARY
0 commit comments