Apply Alembic Migrations #126
This file contains 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
name: Apply Alembic Migrations | |
on: | |
workflow_run: | |
workflows: ["Run Tests"] | |
types: | |
- completed | |
jobs: | |
migrate: | |
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'main' }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v2 | |
- name: "Set up Python" | |
uses: actions/setup-python@v5 | |
with: | |
python-version-file: "pyproject.toml" | |
- name: Install the project | |
run: uv sync --all-extras --dev | |
- name: Apply Alembic migrations | |
env: | |
CI: true | |
ENVIRONMENT: production | |
CHROMA_AUTH_TOKEN_TRANSPORT_HEADER: X-Chroma-Token | |
CHROMA_SERVER_HOST: chroma | |
CHROMA_SERVER_HTTP_PORT: 8000 | |
CHROMA_SERVER_AUTH_CREDENTIALS: test-token | |
CHROMA_SERVER_AUTH_PROVIDER: chromadb.auth.token_authn.TokenAuthClientProvider | |
JWT_SECRET: fake_jwt_secret | |
GROQ_API_KEY: fake_groq_api_key | |
OPENAI_API_KEY: fake_openai_api_key | |
PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }} | |
SUPABASE_KEY: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImF0Z2R2cW10YmJ0aWZ2Z2N0Z3Z3Iiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTYzMjI4MjQsImV4cCI6MjAxMTg5ODgyNH0.i9QWzUY21Y4q0sZ57YB5489J7x089g64vj9229111" | |
SUPABASE_URL: "http://supabase:3000" | |
DATABASE_URL: ${{ secrets.DATABASE_URL }} | |
run: | | |
uv run alembic upgrade head | |
- name: Check for migration errors | |
if: failure() | |
run: | | |
echo "Migration failed. Check the logs for details." | |
exit 1 | |
- name: Notify on success | |
if: success() | |
run: | | |
echo "Migrations applied successfully!" |