firecrawl/.github/workflows/fly.yml

129 lines
3.9 KiB
YAML
Raw Normal View History

2024-04-15 21:01:47 +00:00
name: Fly Deploy
on:
push:
branches:
- main
# schedule:
# - cron: '0 */4 * * *'
2024-04-18 20:44:33 +00:00
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
BULL_AUTH_KEY: ${{ secrets.BULL_AUTH_KEY }}
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
HOST: ${{ secrets.HOST }}
LLAMAPARSE_API_KEY: ${{ secrets.LLAMAPARSE_API_KEY }}
LOGTAIL_KEY: ${{ secrets.LOGTAIL_KEY }}
2024-05-02 19:30:22 +00:00
POSTHOG_API_KEY: ${{ secrets.POSTHOG_API_KEY }}
POSTHOG_HOST: ${{ secrets.POSTHOG_HOST }}
2024-04-18 20:44:33 +00:00
NUM_WORKERS_PER_QUEUE: ${{ secrets.NUM_WORKERS_PER_QUEUE }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
PLAYWRIGHT_MICROSERVICE_URL: ${{ secrets.PLAYWRIGHT_MICROSERVICE_URL }}
PORT: ${{ secrets.PORT }}
REDIS_URL: ${{ secrets.REDIS_URL }}
SCRAPING_BEE_API_KEY: ${{ secrets.SCRAPING_BEE_API_KEY }}
SUPABASE_ANON_TOKEN: ${{ secrets.SUPABASE_ANON_TOKEN }}
SUPABASE_SERVICE_TOKEN: ${{ secrets.SUPABASE_SERVICE_TOKEN }}
SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
TEST_API_KEY: ${{ secrets.TEST_API_KEY }}
2024-04-15 21:01:47 +00:00
jobs:
2024-04-18 20:44:33 +00:00
pre-deploy:
name: Pre-deploy checks
runs-on: ubuntu-latest
services:
redis:
image: redis
ports:
- 6379:6379
steps:
- uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
2024-05-02 19:30:22 +00:00
node-version: "20"
2024-04-18 20:44:33 +00:00
- name: Install pnpm
run: npm install -g pnpm
- name: Install dependencies
run: pnpm install
working-directory: ./apps/api
- name: Start the application
run: npm start &
working-directory: ./apps/api
id: start_app
- name: Start workers
run: npm run workers &
working-directory: ./apps/api
id: start_workers
- name: Run E2E tests
run: |
2024-04-21 19:05:30 +00:00
npm run test:prod
2024-04-18 20:44:33 +00:00
working-directory: ./apps/api
2024-05-08 19:50:02 +00:00
pre-deploy-test-suite:
name: Test Suite
2024-05-08 19:50:55 +00:00
needs: pre-deploy
2024-05-08 19:50:02 +00:00
runs-on: ubuntu-latest
services:
redis:
image: redis
ports:
- 6379:6379
steps:
- uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "20"
- name: Install pnpm
run: npm install -g pnpm
- name: Install dependencies
run: pnpm install
working-directory: ./apps/api
- name: Start the application
run: npm start &
working-directory: ./apps/api
id: start_app
- name: Start workers
run: npm run workers &
working-directory: ./apps/api
id: start_workers
- name: Install dependencies
run: pnpm install
working-directory: ./apps/test-suite
- name: Run E2E tests
run: |
npm run test
working-directory: ./apps/test-suite
2024-05-27 18:54:09 +00:00
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
working-directory: ./apps/python-sdk
- name: Run E2E tests for Python SDK
run: |
pytest firecrawl/__tests__/e2e_withAuth/test.py
working-directory: ./apps/python-sdk
2024-05-27 19:01:48 +00:00
- name: Install dependencies for JavaScript SDK
run: pnpm install
working-directory: ./apps/js-sdk/firecrawl
2024-05-27 18:54:09 +00:00
- name: Run E2E tests for JavaScript SDK
2024-05-27 18:55:48 +00:00
run: npm run test
2024-05-27 18:54:09 +00:00
working-directory: ./apps/js-sdk/firecrawl
2024-05-08 19:50:02 +00:00
2024-04-15 21:01:47 +00:00
deploy:
name: Deploy app
runs-on: ubuntu-latest
2024-05-08 19:47:01 +00:00
needs: pre-deploy-test-suite
2024-04-15 21:01:47 +00:00
steps:
2024-04-15 21:31:31 +00:00
- uses: actions/checkout@v3
2024-04-15 21:01:47 +00:00
- name: Change directory
run: cd apps/api
2024-04-15 21:29:55 +00:00
- uses: superfly/flyctl-actions/setup-flyctl@master
2024-04-15 21:34:12 +00:00
- run: flyctl deploy ./apps/api --remote-only -a firecrawl-scraper-js
2024-04-15 21:01:47 +00:00
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}