From 358d354c5d195008859987a34d4a6315e0d6d91f Mon Sep 17 00:00:00 2001 From: besscroft Date: Wed, 27 Nov 2024 17:02:46 +0800 Subject: [PATCH] ci: test --- .github/workflows/build-test.yaml | 12 ------------ Dockerfile | 11 +++++------ 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build-test.yaml b/.github/workflows/build-test.yaml index b1eb5eb..b4e2420 100644 --- a/.github/workflows/build-test.yaml +++ b/.github/workflows/build-test.yaml @@ -19,18 +19,6 @@ jobs: uses: actions/setup-node@v4 with: node-version: 20 - - name: Set Build Cache - uses: actions/cache@v4 - with: - # See here for caching with `yarn` https://github.com/actions/cache/blob/main/examples.md#node---yarn or you can leverage caching with actions/setup-node https://github.com/actions/setup-node - path: | - ~/.npm - ${{ github.workspace }}/.next/cache - # Generate a new cache whenever packages or source files change. - key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }} - # If source files changed but packages didn't, rebuild from a prior cache. - restore-keys: | - ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}- - name: Install pnpm run: npm install -g pnpm - name: Install dependencies diff --git a/Dockerfile b/Dockerfile index d43ecf3..b39b0de 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,10 +7,9 @@ ENV NODE_ENV production RUN addgroup --system --gid 1001 nodejs RUN adduser --system --uid 1001 nextjs -COPY ./node_modules ./node_modules -COPY ./public ./public -COPY ./prisma ./prisma -COPY ./script.sh ./script.sh +COPY public ./public +COPY prisma ./prisma +COPY script.sh ./script.sh RUN chmod +x script.sh RUN mkdir .next @@ -18,8 +17,8 @@ RUN chown nextjs:nodejs .next # Automatically leverage output traces to reduce image size # https://nextjs.org/docs/advanced-features/output-file-tracing -COPY --chown=nextjs:nodejs ./.next/standalone ./ -COPY --chown=nextjs:nodejs ./.next/static ./.next/static +COPY --chown=nextjs:nodejs .next/standalone ./ +COPY --chown=nextjs:nodejs .next/static ./.next/static USER nextjs