drizzle kit CI Github action

Hey guys, I am trying to automate migrations: I got this Github Action:
migrate:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set DATABASE_URL from secret
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
run: |
echo "DATABASE_URL is $DATABASE_URL"

- name: Cache turbo build setup
uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-

- uses: pnpm/action-setup@v4

- uses: actions/setup-node@v4
with:
node-version: 20.x
registry-url: 'https://registry.npmjs.org'
cache: pnpm

- name: Install dependencies
run: pnpm install

- name: Run Drizzle Migrations
run: |
pnpm db:migrate
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
migrate:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set DATABASE_URL from secret
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
run: |
echo "DATABASE_URL is $DATABASE_URL"

- name: Cache turbo build setup
uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-

- uses: pnpm/action-setup@v4

- uses: actions/setup-node@v4
with:
node-version: 20.x
registry-url: 'https://registry.npmjs.org'
cache: pnpm

- name: Install dependencies
run: pnpm install

- name: Run Drizzle Migrations
run: |
pnpm db:migrate
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
drizzle tells me: No config path provided, using default 'drizzle.config.ts' Reading config file '/home/runner/work/code/code/packages/database/drizzle.config.ts' Error Please provide required params for Postgres driver: [x] url: '' obviously, the secret is provided. I am working in a monorepo. what could be the problem?
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?