Skip to content

Commit cb9fd59

Browse files
committed
build: migrate CI and Docker setup to pnpm
1 parent f71fdc1 commit cb9fd59

2 files changed

Lines changed: 22 additions & 12 deletions

File tree

.github/workflows/ci.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,31 @@ jobs:
1717

1818
strategy:
1919
matrix:
20-
node-version: [18.x]
20+
node-version: [20]
2121

2222
steps:
2323
- name: "☁️ Checkout repository"
2424
uses: actions/checkout@v4
2525

26-
- name: "🔧 Setup Node.js ${{ matrix.node-version }}"
26+
- name: "📦 Install pnpm"
27+
uses: pnpm/action-setup@v4
28+
with:
29+
version: 10
30+
31+
- name: Use Node.js ${{ matrix.node-version }}
2732
uses: actions/setup-node@v4
2833
with:
2934
node-version: ${{ matrix.node-version }}
30-
cache: "npm"
35+
cache: "pnpm"
3136

3237
- name: "📦 Install dependencies"
33-
run: npm ci
38+
run: pnpm install
3439

3540
- name: "🔎 Lint code"
36-
run: npm run lint
41+
run: pnpm run lint
3742

3843
- name: "📝 Checking code format"
39-
run: npm run format:check
44+
run: pnpm run format:check
4045

4146
- name: "🚀 Build the project"
42-
run: npm run build
47+
run: pnpm run build

Dockerfile

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
# Base stage for building the static files
22
FROM node:lts AS base
33
WORKDIR /app
4-
COPY package*.json ./
5-
RUN npm install
4+
5+
# Install pnpm
6+
RUN corepack enable && corepack prepare pnpm@latest --activate
7+
8+
COPY package.json pnpm-lock.yaml ./
9+
RUN pnpm install --frozen-lockfile
10+
611
COPY . .
7-
RUN npm run build
12+
RUN pnpm run build
813

914
# Runtime stage for serving the application
1015
FROM nginx:mainline-alpine-slim AS runtime
11-
COPY --from=base ./app/dist /usr/share/nginx/html
12-
EXPOSE 80
16+
COPY --from=base /app/dist /usr/share/nginx/html
17+
EXPOSE 80

0 commit comments

Comments
 (0)