Fetch Database #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Fetch Database | |
on: | |
workflow_call: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 */5 * *" | |
env: | |
DEV_URL: ${{ secrets.DEV_DIRECT_URL }} | |
PROD_URL: ${{ secrets.PROD_DIRECT_URL }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20] | |
pnpm-version: [9.5.0] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install pnpm ${{ matrix.pnpm-version }} | |
uses: pnpm/action-setup@v3 | |
with: | |
version: ${{ matrix.pnpm-version }} | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: "pnpm" | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Fetch from development database | |
run: pnpm prisma db execute --url "${{ env.DEV_URL }}" --file ./prisma/fetch.sql | |
- name: Fetch from production database | |
run: pnpm prisma db execute --url "${{ env.PROD_URL }}" --file ./prisma/fetch.sql |