Skip to content

chore(deps): bump ajv from 8.12.0 to 8.13.0 (#200) #386

chore(deps): bump ajv from 8.12.0 to 8.13.0 (#200)

chore(deps): bump ajv from 8.12.0 to 8.13.0 (#200) #386

name: Build and Test Dev Docker
on:
push:
branches:
- dev
pull_request:
branches:
- dev
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: SageSeekerSociety/cheese-backend-dev
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Login to docker registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build
uses: docker/build-push-action@v5
with:
context: .
target: dev
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
load: true
- name: Create env file
run: cp sample.env .env
- name: set backend image tag
run: echo "BACKEND_DEV_VERSION=${{ steps.meta.outputs.version }}" >> "$GITHUB_ENV"
- name: Start compose
run: docker compose -f docker-compose.yml -f docker-compose.dev.yml up --no-build -d
- name: Check Schema up to Date
run: |
docker compose exec backend cp prisma/schema.prisma prisma/schema.prisma.origin
docker compose exec backend pnpm build-prisma
docker compose exec backend diff prisma/schema.prisma prisma/schema.prisma.origin
- name: Deploy migrations to Database
run: docker compose exec backend pnpm prisma migrate deploy
- name: Check Prisma Structures Sync With Database
run: |
docker compose exec backend pnpm prisma migrate diff \
--from-schema-datasource prisma/schema.prisma \
--to-schema-datamodel prisma/schema.prisma \
--exit-code
- name: Run Test
run: docker compose exec backend pnpm run test:cov