Skip to content

Commit

Permalink
chore: update ci.yml, fix Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
MinhoJJang committed Aug 8, 2024
1 parent 1eb0b51 commit bd742c7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/nextjs-prod-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,18 @@ jobs:
run: |
npm ci
npm install -g npm@latest
npm install sharp
- name: Lint
run: npm run lint

- name: Build Next.js app
run: npm run build
env:
NEXT_PUBLIC_SERVER_URL: ${{ secrets.NEXT_PUBLIC_SERVER_URL }}
NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }}
NEXTAUTH_URL: ${{ secrets.NEXTAUTH_URL }}

- name: Get latest tag
id: get_latest_tag
run: |
Expand Down Expand Up @@ -87,10 +95,6 @@ jobs:
${{ env.PROJECT_NAME }}.kr-central-2.kcr.dev/${{ env.REPOSITORY_NAME }}/${{ env.IMAGE_NAME }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
NEXT_PUBLIC_SERVER_URL=${{ secrets.NEXT_PUBLIC_SERVER_URL }}
NEXTAUTH_SECRET=${{ secrets.NEXTAUTH_SECRET }}
NEXTAUTH_URL=${{ secrets.NEXTAUTH_URL }}

- name: Create Release
uses: actions/create-release@v1
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ FROM node:18-alpine AS runner
WORKDIR /app

# Set node environment to production
ENV NODE_ENV production
ENV NODE_ENV=production

# Add a non-root user
RUN addgroup --system --gid 1001 nodejs
Expand All @@ -42,7 +42,7 @@ COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static

# Set the correct permission for prerender cache
RUN mkdir .next
RUN mkdir -p .next
RUN chown nextjs:nodejs .next

# Switch to non-root user
Expand Down

0 comments on commit bd742c7

Please sign in to comment.