Skip to content

chore(deps-dev): Bump @testing-library/react from 14.0.0 to 14.2.0 (#… #217

chore(deps-dev): Bump @testing-library/react from 14.0.0 to 14.2.0 (#…

chore(deps-dev): Bump @testing-library/react from 14.0.0 to 14.2.0 (#… #217

Workflow file for this run

name: Deploy
permissions: write-all
on:
release:
types: [published]
push:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash -el {0}
jobs:
database-migration:
name: Database migration
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- uses: pnpm/action-setup@v2.4.0
with:
version: 8
- name: node.js setup
uses: actions/setup-node@v4
with:
node-version: 18
- name: dependency installation
run: pnpm install --frozen-lockfile
- name: Store firebase admin sdk certificate
run: |
mkdir -p ./../.secrets/
echo -n "$KEYSTORE" > ./../.secrets/la-famiglia-parma-ai.json
env:
KEYSTORE: ${{ secrets.GCP_SA_KEY }}
- name: Db model generation
run: pnpx prisma generate
- name: Run migrations
run: |
pnpx prisma migrate deploy
pnpm run manual-db-migration
env:
POSTGRES_URL: ${{ github.event_name == 'release' && secrets.PROD_POSTGRES_URL || secrets.STAGING_POSTGRES_URL }}
# syncing main to staging branch (as vercel deployments are branch based)
staging-deployment:
name: Deploy to staging
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
# force update staging to main
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.RH_PAT_FOR_PUSHING }}
- name: Update staging branch
run: |
git fetch origin
git checkout -B staging origin/main
git push -f origin staging
prod-deployment:
name: Publish release
runs-on: ubuntu-latest
steps:
- name: Trigger deploy webhook
run: curl ${{ github.event_name == 'release' && secrets.PROD_VERCEL_DEPLOY_HOOK_URL || secrets.STAGING_VERCEL_DEPLOY_HOOK_URL}}