Skip to content

Commit

Permalink
fix: ci and Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
DevNono committed Aug 15, 2023
1 parent 41b270d commit 67c5de9
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 12 deletions.
49 changes: 37 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,47 @@ on:
jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18]
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
- uses: pnpm/action-setup@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/pnpm-lock.yaml') }}
version: 8
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- run: pnpm prisma generate
- run: pnpm lint

build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18]
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/pnpm-lock.yaml') }}
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- run: pnpm prisma generate
- run: pnpm build

test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18]
env:
# Used for prisma generation
DATABASE_URL: mysql://test:test@localhost:3306/arena
Expand All @@ -50,10 +67,14 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
- uses: pnpm/action-setup@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/pnpm-lock.yaml') }}
version: 8
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- run: pnpm prisma generate
- run: pnpm prisma db push
Expand All @@ -70,10 +91,14 @@ jobs:
- test
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/pnpm-lock.yaml') }}
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- run: pnpm prisma generate
- env:
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ USER node
# Node has the uid 1000
COPY --chown=node:node package.json pnpm-lock.yaml schema.prisma ./

RUN npm install -g pnpm

RUN pnpm install --frozen-lockfile --production=false

COPY --chown=node:node ./ ./
Expand Down

0 comments on commit 67c5de9

Please sign in to comment.