fix: make migrations use readConfig

This commit is contained in:
diced 2021-06-23 11:47:05 -07:00
parent e9e30c4c46
commit 166087e33c
No known key found for this signature in database
GPG key ID: 85AB64C74535D76E
2 changed files with 6 additions and 6 deletions

View file

@ -3,6 +3,10 @@ name: 'CD: Push Docker Images'
on:
push:
branches: [ trunk ]
paths:
- 'src/**'
- 'server/**'
- 'prisma/**'
workflow_dispatch:
jobs:

View file

@ -3,16 +3,12 @@ const { existsSync } = require('fs');
const { join, extname } = require('path');
const validateConfig = require('../server/validateConfig');
const Logger = require('../src/lib/logger');
const readConfig = require('../src/lib/readConfig');
const mimes = require('./mimes');
const { PrismaClient } = require('@prisma/client');
(async () => {
const str = await readFile('./config.toml');
const config = require('@iarna/toml/parse-string')(str);
if (!existsSync(join(process.cwd(), 'prisma', 'migrations'))) {
Logger.get('server').info('detected an uncreated database - creating...');
await require('../scripts/deploy-db')(config);
}
const config = readConfig();
await validateConfig(config);