Configure FireCrawl CI/CD integration with GitHub Actions and testing.
Use when setting up automated testing, configuring CI pipelines,
or integrating FireCrawl tests into your build process.
Trigger with phrases like "firecrawl CI", "firecrawl GitHub Actions",
"firecrawl automated tests", "CI firecrawl".
Set up CI/CD pipelines to test Firecrawl integrations automatically. Covers GitHub Actions workflow, API key secrets management, integration tests that validate real scraping, and mock-based unit tests for PRs.
Prerequisites
GitHub repository with Actions enabled
Firecrawl API key for testing (separate from production)
@mendable/firecrawl-js installed
Instructions
Step 1: Configure Secrets
set -euo pipefail
# Store test API key in GitHub Actions secrets
gh secret set FIRECRAWL_API_KEY --body "fc-test-key-here"
Step 2: GitHub Actions Workflow
# .github/workflows/firecrawl-tests.yml
name: Firecrawl Integration Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
- run: npm ci
- run: npm test -- --coverage
# Unit tests use mocked SDK — no API key needed
integration-tests:
runs-on: ubuntu-latest
if: github.event_name == 'push' # Only on merge, not PRs (saves credits)
env:
FIRECRAWL_API_KEY: ${{ secrets.FIRECRAWL_API_KEY }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
- run: npm ci
- run: npm run test:integration
timeout-minutes: 5