Skip to main content

    Pre-Deploy Check Tool Guide

    Don't wait until after deployment to discover SEO issues. Integrate pre-deploy checks in CI/CD to automatically verify meta tags, schema, links, images, and ensure every deployment meets SEO standards.

    1) Why Pre-Deploy SEO Checks?

    • Prevention Over Cure: Automatic checks in CI/CD pipelines catch issues before deployment, preventing live traffic impact.
    • Team Collaboration: All developer commits automatically checked—no need for SEO experts to manually review every PR.
    • Consistency: Ensure all pages meet SEO standards (title length, meta completeness, schema format, etc.).
    • Traceability: CI/CD logs record every check result, making it easy to track when SEO issues were introduced.

    2) Check Items & Priority Levels

    🔴 Critical (Block Deployment)
    • Missing title/description (every indexable page must have them)
    • Broken canonical URL (404 or format error)
    • Invalid schema markup (JSON-LD syntax error)
    • 404 internal links (dead links)
    • Duplicate title/description (multiple pages with identical content)
    🟡 Warning (Don't Block, But Alert)
    • Title too long/short (recommended 50-60 chars)
    • Description too long/short (recommended 150-160 chars)
    • Images missing alt tags
    • Missing h1 or multiple h1s
    • External links without rel attribute (nofollow/sponsored/ugc)
    🔵 Info (Informational)
    • Page size (HTML > 500KB)
    • Internal link count (too few < 5)
    • Schema type recommendations (e.g., Article pages should add FAQ)

    3) CI/CD Integration Example: GitHub Actions

    Add SEO check step in .github/workflows/deploy.yml, execute after build and before deploy.

    yaml
    name: Deploy with SEO Check
    
    on:
      push:
        branches: [main]
      pull_request:
        branches: [main]
    
    jobs:
      build-and-check:
        runs-on: ubuntu-latest
        steps:
          - uses: actions/checkout@v4
    
          - name: Setup Node.js
            uses: actions/setup-node@v4
            with:
              node-version: '20'
    
          - name: Install & Build
            run: |
              npm ci
              npm run build
    
          - name: SEO Pre-Deploy Check
            run: |
              # Use this site's API or self-hosted tool
              npx seo-predeploy-check --dir=dist \
                --fail-on=critical \
                --format=github
            continue-on-error: false  # Critical errors fail workflow
    
          - name: Deploy to Production
            if: success()
            run: npm run deploy

    4) Exit Code Control & Custom Rules

    Tools return check results via exit codes, which CI/CD uses to decide whether to continue deployment.

    bash
    # Exit Code Definitions
    0 = Pass (all checks successful)
    1 = Critical error (block deployment)
    2 = Warning (don't block, but log)
    
    # Custom Rules Example
    seo-predeploy-check \
      --dir=dist \
      --fail-on=critical \
      --warn-on=warning \
      --ignore="*.test.html,**/draft/*" \
      --rules='{
        "title": { "min": 50, "max": 60, "required": true },
        "description": { "min": 150, "max": 160, "required": true },
        "canonical": { "required": true, "validate_url": true },
        "schema": { "validate": true, "allow_types": ["Article", "FAQ", "HowTo"] },
        "images": { "require_alt": true, "warn_on_missing": true },
        "links": { "check_internal": true, "fail_on_404": true }
      }'
    
    # Output Formats
    --format=github    # GitHub Actions format (::error::...)
    --format=gitlab    # GitLab CI format
    --format=json      # JSON format (custom parsing)
    --format=markdown  # Markdown report (paste to PR comment)

    5) Local Development & Git Hooks Integration

    Use husky + lint-staged to run checks before commit for earlier problem detection.

    json
    // package.json
    {
      "scripts": {
        "seo-check": "seo-predeploy-check --dir=dist --fail-on=none --warn-on=all"
      },
      "husky": {
        "hooks": {
          "pre-commit": "npm run seo-check"
        }
      }
    }
    
    // Or use lint-staged
    {
      "lint-staged": {
        "src/**/*.{ts,tsx}": [
          "eslint --fix",
          "npm run seo-check"
        ]
      }
    }

    Tip: Local checks should use --fail-on=none (only show warnings) to avoid blocking development flow; use --fail-on=critical in CI/CD.

    6) Check Report Example

    plaintext
    SEO Pre-Deploy Check Report
    ============================
    
    ✅ Passed: 45 pages
    🟡 Warnings: 8 pages
    ❌ Failed: 2 pages
    
    Critical Issues (❌):
      • /blog/new-post.html
        - Missing meta description
        - Invalid canonical URL (404)
    
    Warnings (🟡):
      • /about.html
        - Title too short (42 chars, recommended 50-60)
        - 2 images missing alt tags
      • /products/item-123.html
        - Description too long (185 chars, recommended 150-160)
        - Missing h1 tag
    
    Summary:
      Total pages checked: 55
      Total issues: 10 (2 critical, 8 warnings)
      Recommendation: Fix critical issues before deploy
    
    Exit Code: 1 (Critical errors found, deployment blocked)

    Related Resources

    FAQ

    Pre-deploy check tool integration and configuration.