Fix Dockerfile
and production start script
#376
Workflow file for this run
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: Test the PR | |
on: | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build-and-test: | |
name: Build and test with Node.js ${{ matrix.node-version }} and ${{ matrix.db }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18, 20] # See supported Node.js release schedule at https://nodejs.org/en/about/releases | |
db: [postgresql, mysql, mongodb, sqlite] | |
env: | |
DB_PROVIDER: ${{ matrix.db }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'pnpm' | |
- name: Install modules | |
run: pnpm install | |
- name: Check code formatting | |
run: pnpm run lint | |
- name: Generate Prisma Client | |
run: pnpm run prisma:gen | |
- name: Build | |
run: pnpm run build | |
- name: Run unit tests | |
run: pnpm run test | |
build-and-test-docker: | |
name: Build and test Docker image | |
runs-on: ubuntu-latest | |
env: | |
DB_PROVIDER: postgresql | |
DB_HOST: db | |
DB_PORT: 5432 | |
DB_USERNAME: postgres | |
DB_PASSWORD: secret | |
DB_NAME: testdb | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build the Docker image | |
run: docker buildx build --platform linux/amd64,linux/arm64 -t idn-area:${{ github.sha }} . | |
- name: Run Docker compose | |
run: docker-compose -f /mnt/data/docker-compose.yml up -d | |
- name: Run e2e tests with Docker | |
run: | | |
docker-compose -f /mnt/data/docker-compose.yml exec app \ | |
pnpm run test:e2e | |
- name: Tear down Docker compose | |
run: docker-compose -f /mnt/data/docker-compose.yml down |