diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7783c064..9dea4922 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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 @@ -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: diff --git a/Dockerfile b/Dockerfile index ed13a9d3..1a6e498b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 ./ ./