Skip to content

nextjs build cache #452

nextjs build cache

nextjs build cache #452

Workflow file for this run

name: Build
on: [push]
jobs:
# This job runs tests for Auth0 actions
auth0-tenant:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22.x]
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup workspace
uses: ./.github/actions/setup
with:
node-version: ${{ matrix.node-version }}
nx-cache-key: nx-cache-${{ github.job }}-${{ runner.os }}-${{ matrix.node-version }}
- name: Run tests
run: pnpm nx test auth0-tenant
# This job builds the Hono API backend
api:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22.x]
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup workspace
uses: ./.github/actions/setup
with:
node-version: ${{ matrix.node-version }}
nx-cache-key: nx-cache-${{ github.job }}-${{ runner.os }}-${{ matrix.node-version }}
- name: Generate Prisma database schema
run: pnpm nx prisma:generate mold-inventory-api
- name: Type Check
run: pnpm nx type-check mold-inventory-api
- name: Lint
run: pnpm nx lint mold-inventory-api
- name: Prettier
run: pnpm nx prettier mold-inventory-api
- name: Run tests
run: pnpm nx test mold-inventory-api
# This job builds the Next.js app and runs tests.
app:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22.x]
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup workspace
uses: ./.github/actions/setup
with:
node-version: ${{ matrix.node-version }}
nx-cache-key: nx-cache-${{ github.job }}-${{ runner.os }}-${{ matrix.node-version }}
- name: Restore Next.js build cache
uses: actions/cache@v5
with:
path: |
./apps/mold-inventory-app/.next
key: nextjs-cache-${{ github.job }}-${{ runner.os }}-${{ matrix.node-version }}
restore-keys: |
nextjs-cache-${{ github.job }}-${{ runner.os }}-${{ matrix.node-version }}
- name: Type Check
run: pnpm nx type-check mold-inventory-app
- name: Lint
working-directory: ./apps/mold-inventory-app
run: pnpm lint
- name: Prettier
run: pnpm nx prettier mold-inventory-app
- name: Next.js Build
run: pnpm nx build mold-inventory-app
- name: Run tests
run: pnpm nx test mold-inventory-app
# This job builds the Next.js app for Cloudflare workerd runtime and runs tests.
app-cf:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22.x]
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup workspace
uses: ./.github/actions/setup
with:
node-version: ${{ matrix.node-version }}
nx-cache-key: nx-cache-${{ github.job }}-${{ runner.os }}-${{ matrix.node-version }}
- name: Restore Next.js build cache
uses: actions/cache@v5
with:
path: |
./apps/mold-inventory-app/.next
./apps/mold-inventory-app/.open-next
key: nextjs-cache-${{ github.job }}-${{ runner.os }}-${{ matrix.node-version }}
restore-keys: |
nextjs-cache-${{ github.job }}-${{ runner.os }}-${{ matrix.node-version }}
- name: Type Check
run: pnpm nx type-check mold-inventory-app
- name: Lint
working-directory: ./apps/mold-inventory-app
run: pnpm lint
- name: Prettier
run: pnpm nx prettier mold-inventory-app
- name: Next.js build for Cloudflare workerd runtime
run: pnpm nx cf:build mold-inventory-app
- name: Run tests
run: pnpm nx test mold-inventory-app
# This job lints the MCP Server
mcp:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22.x]
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup workspace
uses: ./.github/actions/setup
with:
node-version: ${{ matrix.node-version }}
nx-cache-key: nx-cache-${{ github.job }}-${{ runner.os }}-${{ matrix.node-version }}
- name: Type Check
run: pnpm nx type-check molds-mcp
- name: Prettier
run: pnpm nx prettier molds-mcp