Skip to content

Commit

Permalink
refactor: Move to pnpm
Browse files Browse the repository at this point in the history
Signed-off-by: Helio Chissini de Castro <[email protected]>
  • Loading branch information
heliocastro committed Dec 16, 2024
1 parent e9678e5 commit fa96777
Show file tree
Hide file tree
Showing 8 changed files with 6,761 additions and 11,046 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ Dockerfile
.dockerignore
.git
.env
node_modules
18 changes: 11 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,29 +32,33 @@ jobs:
- name: Checkout source code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: pnpm-setup
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
with:
version: 8

- name: Setup Node
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: '22'
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
cache: 'pnpm'

- name: 📦 Install constrained dependencies
- name: 📦 Install dependencies
shell: bash
run: |
npm ci
pnpm i
- name: 🔄 Check for outdated dependencies
shell: bash
run: |
npm outdated || echo "::warning title=Outdated dependencies::Some dependencies are outdated and need to be updated"
pnpm outdated >> $GITHUB_STEP_SUMMARY
- name: Run linting
shell: bash
run: |
npm run lint
pnpm lint
- name: Run build
shell: bash
run: |
npm run build
pnpm build
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ next-env.d.ts

# Other Lock files
yarn.lock
pnpm-lock.yaml
package-lock.yaml

# Aria
.hintrc
Expand Down
15 changes: 8 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,24 @@
# SPDX-License-Identifier: EPL-2.0
# License-Filename: LICENSE

ARG VARIANT=22-alpine
ARG VARIANT=22-slim
FROM node:${VARIANT} as build

ENV PNPM_HOME="/pnm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable

WORKDIR /frontend

# Prepare the build environment
COPY package.json .
RUN npm install
COPY . .
RUN npm run build --production
RUN pnpm install && pnpm build

# Runtime
ARG VARIANT=20-alpine
ARG VARIANT=22-slim
FROM node:${VARIANT}
WORKDIR /frontend

COPY --from=build /frontend/package.json .
COPY --from=build /frontend/package-lock.json .
COPY --from=build /frontend/next.config.js .
COPY --from=build /frontend/public ./public
COPY --from=build /frontend/.next/standalone ./
Expand Down
Loading

0 comments on commit fa96777

Please sign in to comment.