Skip to content

Commit 8b04b38

Browse files
authored
Merge pull request #31 from teacoder-team/dev
chore: migrate Dockerfile from npm to pnpm
2 parents 031c0b0 + ffe5e9a commit 8b04b38

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

.github/workflows/release.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,22 @@ jobs:
3838
- name: 🛠️ Build packages
3939
run: pnpm build:packages
4040

41+
- name: 🕵️‍♂️ Check if version exists on npm
42+
id: check_version
43+
run: |
44+
VERSION=$(jq -r '.version' packages/nestjs-yookassa/package.json)
45+
echo "Current package version: $VERSION"
46+
47+
if npm view nestjs-yookassa@$VERSION version > /dev/null 2>&1; then
48+
echo "Version $VERSION already exists on npm. Skipping publish."
49+
echo "should_publish=false" >> $GITHUB_OUTPUT
50+
else
51+
echo "Version $VERSION does not exist. Will publish."
52+
echo "should_publish=true" >> $GITHUB_OUTPUT
53+
fi
54+
4155
- name: 🚀 Publish to NPM
56+
if: steps.check_version.outputs.should_publish == 'true'
4257
working-directory: packages/nestjs-yookassa
4358
run: pnpm publish --access public
4459
env:

apps/www/Dockerfile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@ FROM node:20-alpine AS build
22

33
WORKDIR /app
44

5-
COPY package*.json ./
5+
RUN npm install -g pnpm
66

7-
RUN npm install --legacy-peer-deps
7+
COPY pnpm-lock.yaml ./
8+
COPY package.json ./
9+
10+
RUN pnpm install --frozen-lockfile
811

912
COPY . .
1013

11-
RUN npm run build
14+
RUN pnpm run build
1215

13-
EXPOSE 3000
16+
EXPOSE 5000
1417

15-
CMD ["npm", "run", "start"]
18+
CMD ["pnpm", "run", "start"]

0 commit comments

Comments
 (0)