SEO Checks #97
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This workflow runs comprehensive SEO checks including robots.txt, sitemap.xml, and meta tags | |
| name: SEO Checks | |
| on: | |
| deployment_status: | |
| workflow_dispatch: | |
| jobs: | |
| seo-checks: | |
| # Only run if deployment was successful and it's a production deployment | |
| if: | |
| github.event_name == 'workflow_dispatch' || github.event_name == | |
| 'push' || (github.event.deployment_status.state == 'success' && | |
| github.event.deployment_status.environment == 'production') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Install Playwright browsers | |
| run: npx playwright install --with-deps chromium | |
| - name: Run SEO Checks | |
| run: | |
| npx playwright test tests/e2e/robots.test.ts | |
| tests/e2e/sitemap.test.ts tests/e2e/blog-meta-tags.test.ts | |
| tests/e2e/og-preview-images.spec.ts --project=chromium | |
| env: | |
| # Override base URL to test production | |
| PLAYWRIGHT_BASE_URL: https://maxdaten.io | |
| - name: Upload Playwright Report | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: playwright-report-seo-checks | |
| path: playwright-report/ | |
| retention-days: 10 | |
| - name: Upload Test Results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: test-results-seo-checks | |
| path: test-results/ | |
| retention-days: 10 | |
| notify-on-failure: | |
| needs: seo-checks | |
| runs-on: ubuntu-latest | |
| if: failure() | |
| steps: | |
| - name: Notify on test failure | |
| run: | | |
| echo "SEO checks failed!" | |
| echo "Check the test results and Playwright report artifacts for details." | |
| # You can add additional notification steps here (Slack, email, etc.) |