Surqo uses a GitHub Actions pipeline defined inDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ricardomb-tech/surqo/llms.txt
Use this file to discover all available pages before exploring further.
.github/workflows/ci-cd.yml that runs on every push and pull request targeting master or main. The pipeline has two jobs: a test job that lints and runs the full test suite (fires on both pushes and PRs), and a deploy-backend job that deploys to Fly.io (fires only on push to master). Frontend deploys are handled automatically by Vercel’s GitHub Integration and require no additional pipeline configuration.
Pipeline Overview
Required GitHub Secrets
Before the pipeline can run successfully, add the following secrets to your GitHub repository under Settings → Secrets and variables → Actions.| Secret Name | Description |
|---|---|
GROQ_API_KEY | Groq API key for LLM calls (gsk_...) |
ANTHROPIC_API_KEY | Anthropic API key — optional fallback |
SUPABASE_URL | Supabase project URL (https://xxx.supabase.co) |
SUPABASE_KEY | Supabase service role key |
FLY_API_TOKEN | Fly.io deploy token (see below) |
If
GROQ_API_KEY or ANTHROPIC_API_KEY are not set, the workflow falls back to safe placeholder values for the test job (e.g. GROQ_API_KEY defaults to 'test_key', SUPABASE_URL to a placeholder URL). The deploy-backend job will fail if FLY_API_TOKEN is missing. Other runtime secrets (Redis, HiveMQ, Resend, etc.) are hardcoded to test-safe values directly in the workflow and do not need to be set as GitHub Secrets.Test Job
Thetest job runs on ubuntu-latest with its working directory set to backend/. It uses astral-sh/setup-uv@v3 to install Python 3.11 and uv in a single step, avoiding the separate actions/setup-python action.
DATABASE_URLis set tosqlite+aiosqlite:///:memory:— a temporary in-memory SQLite database, no PostgreSQL instance needed.REDIS_URLis set toredis://localhost:6379— tests stub Redis calls via fixtures inconftest.py.APP_ENVis set totest— disables Logfire tracing and other production-only middleware.
Tests use SQLite in-memory via
conftest.py fixtures — no external database needed in CI. The test suite covers 86+ automated tests across API endpoints, services, and business logic, including farms CRUD, sensor readings, alert thresholds, KPI calculations, LLM service mocking, and email cooldown logic.Deploy Job
Thedeploy-backend job only runs when all three conditions are true:
- The
testjob succeeded. - The event is a
push(not apull_request). - The branch is
refs/heads/master.
flyctl handles everything else:
- Check out the code (
actions/checkout@v4). - Install
flyctlviasuperfly/flyctl-actions/setup-flyctl@master. - Run
flyctl deploy --remote-onlyfrom thebackend/directory.
--remote-only flag builds the Docker image on Fly.io’s remote builders, so the GitHub-hosted runner never needs Docker installed locally.
The deploy job only runs on push to
master — not on PRs. This means every pull request runs linting and tests to catch regressions, but only merged code reaches production.Generating the Fly.io Deploy Token
TheFLY_API_TOKEN secret authorises flyctl to deploy on behalf of your Fly.io account.
Frontend: Vercel GitHub Integration
The frontend deploy does not go through GitHub Actions. Vercel listens to the same GitHub repository via its native integration:- Pull requests → Vercel creates an isolated preview deployment with a unique URL.
- Push to
master→ Vercel triggers an automatic production deploy tosurqo.online.
FLY_API_TOKEN equivalent is needed for the frontend — the Vercel connection is configured once in the Vercel dashboard and runs automatically thereafter. See the Frontend (Vercel) page for setup instructions.
Full Workflow Reference
The complete.github/workflows/ci-cd.yml defines three jobs: test, deploy-backend, and notify-deploy. The notify-deploy job runs after deploy-backend regardless of its result and prints a human-readable summary of what was deployed:
deploy-backend was skipped (because tests failed) or failed (because flyctl errored), notify-deploy exits with a non-zero code, making the overall workflow status red in the GitHub UI.