Files
kjvstudy.org/.github/workflows/fly-deploy.yml
T
kennethreitz 6994d96f94 Add GitHub Actions CI/CD with automated testing
New workflow: test.yml
- Runs on push to main and all pull requests
- Executes full test suite with pytest
- Generates coverage report
- Includes optional code quality checks

Updated workflow: fly-deploy.yml
- Added test job that runs before deployment
- Deploy only happens if all tests pass
- Prevents deploying broken code to production

Updated dependencies:
- Added pytest-cov for coverage reporting in CI

The test suite (100+ tests) now runs automatically:
- On every push to main
- On every pull request
- Before every deployment to Fly.io

This ensures code quality and prevents regressions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-24 13:03:06 -05:00

42 lines
983 B
YAML

# See https://fly.io/docs/app-guides/continuous-deployment-with-github-actions/
name: Fly Deploy
on:
push:
branches:
- main
jobs:
test:
name: Run tests before deploy
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: "latest"
- name: Set up Python
run: uv python install 3.13
- name: Install dependencies
run: uv sync
- name: Run tests
run: uv run pytest tests/ -v --tb=short
deploy:
name: Deploy app
runs-on: ubuntu-latest
needs: test # Only deploy if tests pass
concurrency: deploy-group # optional: ensure only one action runs at a time
steps:
- uses: actions/checkout@v4
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}