Skip to content

Commit a9e0c75

Browse files
committed
enable auto migrations in cloud
1 parent 62c5c8e commit a9e0c75

3 files changed

Lines changed: 27 additions & 183 deletions

File tree

.github/workflows/build_deploy_dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Build and deploy to dev
22

33
on:
4-
pull_request_target:
4+
pull_request:
55
types: [opened, reopened, synchronize, labeled]
66
branches:
77
- 'main'

.github/workflows/deploy.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,37 @@ on:
1616
required: true
1717
REPO_DISPATCH_PAT_TOKEN:
1818
required: true
19+
MINDSDB_DB_CON:
20+
required: true
1921

2022
jobs:
23+
migrate:
24+
if: github.actor != 'mindsdbadmin'
25+
runs-on: ${{ matrix.deploy-env == 'prod' && 'mdb-prod' || 'mdb-dev' }}
26+
strategy:
27+
fail-fast: false
28+
matrix:
29+
deploy-env: ${{ fromJson(inputs.deploy-envs) }}
30+
environment:
31+
MINDSDB_DB_CON: ${{ secrets.MINDSDB_DB_CON }}
32+
33+
# We only want to run one deploy job for an env at a time
34+
# Don't cancel in progress jobs because it may be for a different PR
35+
concurrency:
36+
group: deploy-${{ matrix.deploy-env }}
37+
cancel-in-progress: false
38+
steps:
39+
- uses: actions/checkout@v4
40+
- name: Migrate DB
41+
run: |
42+
cd mindsdb/migrations
43+
env PYTHONPATH=../../ alembic upgrade head
44+
45+
2146
# Trigger private repo to deploy
2247
trigger_deploy:
2348
if: github.actor != 'mindsdbadmin'
49+
needs: migrate
2450
runs-on: mdb-dev
2551
strategy:
2652
fail-fast: false

docker/docker-compose-ci.yml

Lines changed: 0 additions & 182 deletions
This file was deleted.

0 commit comments

Comments
 (0)