From bd814495347b4ce1d1cf33af6c4f0149405437cc Mon Sep 17 00:00:00 2001 From: suyiiyii Date: Sat, 28 Sep 2024 01:27:11 +0800 Subject: [PATCH] =?UTF-8?q?:construction=5Fworker:=20=E5=B0=86=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=8C=96=E5=B7=A5=E5=85=B7=E4=B8=AD=E7=9A=84=20yarn?= =?UTF-8?q?=20=E6=9B=BF=E6=8D=A2=E4=B8=BA=20pnpm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .devcontainer/devcontainer.json | 2 +- .github/actions/build-docs/action.yml | 4 ++-- .github/actions/build-frontend/action.yml | 4 ++-- .github/actions/setup-node/action.yml | 13 +++++++++---- docker/Dockerfile | 3 ++- 5 files changed, 16 insertions(+), 10 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index da76a2b..d6558d0 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -4,7 +4,7 @@ "features": { "ghcr.io/devcontainers-contrib/features/poetry:2": {} }, - "postCreateCommand": "poetry config virtualenvs.in-project true && poetry install -E all && poetry run pre-commit install && yarn install", + "postCreateCommand": "poetry config virtualenvs.in-project true && poetry install -E all && poetry run pre-commit install && npm install -g pnpm && pnpm install", "customizations": { "vscode": { "settings": { diff --git a/.github/actions/build-docs/action.yml b/.github/actions/build-docs/action.yml index 5a296a3..0f82548 100644 --- a/.github/actions/build-docs/action.yml +++ b/.github/actions/build-docs/action.yml @@ -10,5 +10,5 @@ runs: - name: Build Frontend shell: bash run: | - yarn install - yarn docs:build + pnpm install + pnpm docs:build diff --git a/.github/actions/build-frontend/action.yml b/.github/actions/build-frontend/action.yml index aa39679..a3117b6 100644 --- a/.github/actions/build-frontend/action.yml +++ b/.github/actions/build-frontend/action.yml @@ -11,5 +11,5 @@ runs: shell: bash working-directory: ./admin-frontend run: | - yarn install - yarn build + pnpm install + pnpm build diff --git a/.github/actions/setup-node/action.yml b/.github/actions/setup-node/action.yml index 83c3f27..db2d83f 100644 --- a/.github/actions/setup-node/action.yml +++ b/.github/actions/setup-node/action.yml @@ -8,11 +8,16 @@ runs: with: node-version: "20" - - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" + - name: Set Up Pnpm + uses: https://git.dsvision.net/actions/pnpm-setup@v2 + with: + version: 9.10.0 + + - id: pnpm-cache-dir-path + run: echo "::set-output name=dir::$(pnpm store path)" shell: bash - uses: actions/cache@v4 with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + path: ${{ steps.pnpm-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} diff --git a/docker/Dockerfile b/docker/Dockerfile index 0b5d4b3..4147e6f 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,7 +1,8 @@ FROM node:20.17.0 as frontend ADD . /app WORKDIR /app/admin-frontend -RUN yarn && yarn build +RUN npm install -g pnpm +RUN pnpm install && pnpm build FROM python:3.11 RUN python3 -m pip install poetry && poetry config virtualenvs.create false