Skip to content

Deploy DB Model

Deploy DB Model #496

name: Deploy DB Model
on:
workflow_run:
# Esto tiene q hacer match con los nombres de los workflows de tests
workflows: ["Graphql and Database Tests", "Lint and Typecheck"]
branches: [main]
types:
- completed
jobs:
deploy:
# if: ${{ github.event.workflow_run.conclusion == 'success' }}
name: Deploy to dbdocs.io
runs-on: ubuntu-latest
steps:
- name: ⏳ Cloning repo
uses: actions/checkout@v4
with:
show-progress: false
- name: ⬢ Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
- name: 📦 Download Cached Package Dependencies
uses: actions/cache@v3
env:
cache-name: NPM
with:
path: ~/.npm
key: CACHE-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
- name: 📥 Install dependencies
run: npm ci --prefer-offline --no-audit --legacy-peer-deps --cache ~/.npm
- name: 🛠️ Build new DB model
run: npm run db:model
- name: 🛳️ Deploy DB model
env:
DBDOCS_TOKEN: ${{ secrets.DBDOCS_TOKEN }}
run: npx dbdocs build ./drizzle/schema.dbml --project API