mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-09 15:07:55 -05:00
feat(versioning): added api deployment versioning, change detection in workflow, added ci job to run migrations on merge to main (#220)
* added initial code for versioning * ran migrations & improvements to versioning * change sensitivity of state diff checker * debounce the change detection function * cleaned up file structure * added ci job to run migrations when merging to main * ran migrations * cleanup unused files, remove unused dependencies
This commit is contained in:
34
.github/workflows/ci.yml
vendored
34
.github/workflows/ci.yml
vendored
@@ -26,6 +26,12 @@ jobs:
|
||||
working-directory: ./sim
|
||||
run: npm ci
|
||||
|
||||
- name: Fix Rollup module issue
|
||||
working-directory: ./sim
|
||||
run: |
|
||||
rm -rf node_modules package-lock.json
|
||||
npm install
|
||||
|
||||
- name: Run tests with coverage
|
||||
working-directory: ./sim
|
||||
env:
|
||||
@@ -41,4 +47,30 @@ jobs:
|
||||
with:
|
||||
directory: ./sim/coverage
|
||||
fail_ci_if_error: false
|
||||
verbose: true
|
||||
verbose: true
|
||||
|
||||
migrations:
|
||||
name: Apply Database Migrations
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||
needs: test
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
cache: 'npm'
|
||||
cache-dependency-path: './sim/package-lock.json'
|
||||
|
||||
- name: Install dependencies
|
||||
working-directory: ./sim
|
||||
run: npm ci
|
||||
|
||||
- name: Apply migrations
|
||||
working-directory: ./sim
|
||||
env:
|
||||
POSTGRES_URL: ${{ secrets.DATABASE_URL }}
|
||||
run: npx drizzle-kit push
|
||||
Reference in New Issue
Block a user