Skip to content

Commit

Permalink
feat: use pnpm from corepack to install dependency
Browse files Browse the repository at this point in the history
Since package.json already has the packageManager field specified
with pnpm and its specific version, there is no reason not to use
it during whole dev/build process.
  • Loading branch information
OrkWard committed Jan 2, 2025
1 parent b2d06f0 commit b69833c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4,002 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,8 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: '20'

- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: 8
run_install: false
- name: Enable corepack
run: corepack enable

- name: Get pnpm store directory
shell: bash
Expand Down
12 changes: 4 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
FROM python:3.10.5-slim AS develop-py
WORKDIR /root/running_page
COPY ./requirements.txt /root/running_page/requirements.txt
# Add proxy for apt.
# ENV http_proxy http://ip_address:port
# ENV https_proxy http://ip_address:port
RUN apt-get update \
&& apt-get install -y --no-install-recommends git \
&& apt-get purge -y --auto-remove \
Expand All @@ -17,10 +14,9 @@ FROM node:18 AS develop-node
WORKDIR /root/running_page
COPY ./package.json /root/running_page/package.json
COPY ./pnpm-lock.yaml /root/running_page/pnpm-lock.yaml
RUN npm config rm proxy&&npm config set registry https://registry.npmjs.org/ \
&&npm install -g corepack \
&&corepack enable \
&&yarn install
RUN npm config set registry https://registry.npmjs.org/ \
&& corepack enable \
&& pnpm install

FROM develop-py AS data
ARG app
Expand Down Expand Up @@ -61,7 +57,7 @@ RUN python3 run_page/gen_svg.py --from-db --title "my running page" --type grid
FROM develop-node AS frontend-build
WORKDIR /root/running_page
COPY --from=data /root/running_page /root/running_page
RUN yarn run build
RUN pnpm run build

FROM nginx:alpine AS web
COPY --from=frontend-build /root/running_page/dist /usr/share/nginx/html/
Expand Down
Loading

0 comments on commit b69833c

Please sign in to comment.