diff --git a/.github/workflows/web.yml b/.github/workflows/web.yml index 51752c80a..0180b8326 100644 --- a/.github/workflows/web.yml +++ b/.github/workflows/web.yml @@ -34,6 +34,9 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Log in to the Container registry if: github.event_name == 'push' uses: docker/login-action@v3 @@ -50,6 +53,8 @@ jobs: tags: | ${{ env.CONTAINER_REGISTRY }}/${{ env.CONTAINER_REPOSITORY }}:${{ env.CONTAINER_IMAGE_TAG_UNIQUE }} ${{ env.CONTAINER_REGISTRY }}/${{ env.CONTAINER_REPOSITORY }}:latest + cache-from: type=gha + cache-to: type=gha,mode=max deploy: name: Deploy diff --git a/web/Dockerfile b/web/Dockerfile index 3b9002d24..a8ecf0303 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -1,6 +1,6 @@ -# https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile +# syntax=docker/dockerfile:1 -# syntax=docker.io/docker/dockerfile:1 +# https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile FROM node:24-alpine AS base @@ -12,7 +12,7 @@ WORKDIR /app # Install dependencies based on the preferred package manager COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* .npmrc* ./ -RUN \ +RUN --mount=type=cache,target=/app/.next/cache \ if [ -f yarn.lock ]; then yarn --frozen-lockfile; \ elif [ -f package-lock.json ]; then npm ci; \ elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm i --frozen-lockfile; \