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 }}