Skip to content

fix: Complete TypeScript and ESLint cleanup #7

fix: Complete TypeScript and ESLint cleanup

fix: Complete TypeScript and ESLint cleanup #7

name: Deploy Landing Page & Documentation
on:
push:
branches: [main, recovery-agents-enhancement]
paths:
- 'index.html'
- 'docs/**'
- 'CNAME'
- 'package.json'
- 'package-lock.json'
- 'webpack.config.js'
- 'src/docs/**'
- 'scripts/**'
- '.github/workflows/deploy-landing.yml'
pull_request:
branches: [main, recovery-agents-enhancement]
paths:
- 'index.html'
- 'docs/**'
- 'CNAME'
- 'package.json'
- 'package-lock.json'
- 'webpack.config.js'
- 'src/docs/**'
- 'scripts/**'
- '.github/workflows/deploy-landing.yml'
workflow_dispatch: # Allow manual triggering
jobs:
build-and-deploy:
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
id-token: write
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch full history for proper git operations
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: package-lock.json
- name: Install Dependencies
run: npm ci
- name: Build Documentation
run: npm run build:docs
- name: Verify Build
run: |
echo "📁 Build directory contents:"
ls -la build/
echo ""
echo "📄 HTML files generated:"
find build/ -name "*.html" -type f | head -20
echo ""
echo "🔍 Search index generated:"
if [ -f "build/assets/search-index.json" ]; then
echo "✅ Search index exists"
echo "📊 Pages indexed:"
jq '. | length' build/assets/search-index.json
else
echo "❌ Search index missing"
fi
echo ""
echo "🗺️ Sitemap generated:"
if [ -f "build/sitemap.xml" ]; then
echo "✅ Sitemap exists"
echo "📏 Sitemap size:"
wc -l build/sitemap.xml
else
echo "❌ Sitemap missing"
fi
- name: Check for CNAME
run: |
if [ -f "CNAME" ]; then
echo "✅ CNAME file found"
echo "📝 Domain:"
cat CNAME
cp CNAME build/
else
echo "⚠️ No CNAME file found"
fi
- name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/recovery-agents-enhancement'
uses: actions/deploy-pages@v4
with:
path: build
- name: Setup Pages
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/recovery-agents-enhancement'
uses: actions/configure-pages@v4
- name: Upload Pages Artifact
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/recovery-agents-enhancement'
uses: actions/upload-pages-artifact@v3
with:
path: build
deploy:
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/recovery-agents-enhancement'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build-and-deploy
permissions:
pages: write
id-token: write
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
- name: Report Deployment Status
run: |
echo "🚀 Deployment completed successfully!"
echo "🌐 Site URL: ${{ steps.deployment.outputs.page_url }}"
echo "⏰ Deployed at: $(date -u '+%Y-%m-%d %H:%M:%S UTC')"
echo "📝 Commit: ${{ github.sha }}"
echo "👤 Author: ${{ github.actor }}"
- name: Post to PR (if applicable)
if: github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
script: |
const issue_number = context.issue.number;
const owner = context.repo.owner;
const repo = context.repo.repo;
const page_url = '${{ steps.deployment.outputs.page_url }}';
// Find an existing comment or create a new one
const comments = await github.rest.issues.listComments({
owner,
repo,
issue_number,
});
const bot_comment = comments.data.find(comment =>
comment.user.type === 'Bot' &&
comment.body.includes('🚀 Preview deployment')
);
const comment_body = `## 🚀 Preview deployment
Your documentation changes have been deployed and are available for preview:
🌐 **Preview URL**: [${page_url}](${page_url})
📋 **Changes in this PR**:
- Landing page and documentation build
- Search index generation
- Sitemap generation
- Responsive design with musical theme (♫)
⏰ **Deployed at**: ${new Date().toISOString()}
---
*This is an automated preview deployment. Changes will be published to the main site when this PR is merged into the main branch.*`;
if (bot_comment) {
await github.rest.issues.updateComment({
owner,
repo,
comment_id: bot_comment.id,
body: comment_body,
});
} else {
await github.rest.issues.createComment({
owner,
repo,
issue_number,
body: comment_body,
});
}