| - name: Install pnpm | - name: Install pnpm | ||||
| uses: pnpm/action-setup@v4 | uses: pnpm/action-setup@v4 | ||||
| with: | with: | ||||
| version: 10 | |||||
| package_json_file: web/package.json | |||||
| run_install: false | run_install: false | ||||
| - name: Setup NodeJS | - name: Setup NodeJS | ||||
| - name: Web dependencies | - name: Web dependencies | ||||
| if: steps.changed-files.outputs.any_changed == 'true' | if: steps.changed-files.outputs.any_changed == 'true' | ||||
| working-directory: ./web | |||||
| run: pnpm install --frozen-lockfile | run: pnpm install --frozen-lockfile | ||||
| - name: Web style check | - name: Web style check | ||||
| if: steps.changed-files.outputs.any_changed == 'true' | if: steps.changed-files.outputs.any_changed == 'true' | ||||
| working-directory: ./web | |||||
| run: pnpm run lint | run: pnpm run lint | ||||
| docker-compose-template: | docker-compose-template: |
| - name: Install pnpm | - name: Install pnpm | ||||
| uses: pnpm/action-setup@v4 | uses: pnpm/action-setup@v4 | ||||
| with: | with: | ||||
| version: 10 | |||||
| package_json_file: web/package.json | |||||
| run_install: false | run_install: false | ||||
| - name: Set up Node.js | - name: Set up Node.js | ||||
| - name: Install dependencies | - name: Install dependencies | ||||
| if: env.FILES_CHANGED == 'true' | if: env.FILES_CHANGED == 'true' | ||||
| working-directory: ./web | |||||
| run: pnpm install --frozen-lockfile | run: pnpm install --frozen-lockfile | ||||
| - name: Generate i18n translations | - name: Generate i18n translations | ||||
| if: env.FILES_CHANGED == 'true' | if: env.FILES_CHANGED == 'true' | ||||
| working-directory: ./web | |||||
| run: pnpm run auto-gen-i18n ${{ env.FILE_ARGS }} | run: pnpm run auto-gen-i18n ${{ env.FILE_ARGS }} | ||||
| - name: Create Pull Request | - name: Create Pull Request |
| if: steps.changed-files.outputs.any_changed == 'true' | if: steps.changed-files.outputs.any_changed == 'true' | ||||
| uses: pnpm/action-setup@v4 | uses: pnpm/action-setup@v4 | ||||
| with: | with: | ||||
| version: 10 | |||||
| package_json_file: web/package.json | |||||
| run_install: false | run_install: false | ||||
| - name: Setup Node.js | - name: Setup Node.js | ||||
| - name: Install dependencies | - name: Install dependencies | ||||
| if: steps.changed-files.outputs.any_changed == 'true' | if: steps.changed-files.outputs.any_changed == 'true' | ||||
| working-directory: ./web | |||||
| run: pnpm install --frozen-lockfile | run: pnpm install --frozen-lockfile | ||||
| - name: Run tests | - name: Run tests | ||||
| if: steps.changed-files.outputs.any_changed == 'true' | if: steps.changed-files.outputs.any_changed == 'true' | ||||
| working-directory: ./web | |||||
| run: pnpm test | run: pnpm test |
| # RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories | # RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories | ||||
| RUN apk add --no-cache tzdata | RUN apk add --no-cache tzdata | ||||
| RUN npm install -g pnpm@10.13.1 | |||||
| RUN corepack enable | |||||
| ENV PNPM_HOME="/pnpm" | ENV PNPM_HOME="/pnpm" | ||||
| ENV PATH="$PNPM_HOME:$PATH" | ENV PATH="$PNPM_HOME:$PATH" | ||||
| COPY package.json . | COPY package.json . | ||||
| COPY pnpm-lock.yaml . | COPY pnpm-lock.yaml . | ||||
| # Use packageManager from package.json | |||||
| RUN corepack install | |||||
| # if you located in China, you can use taobao registry to speed up | # if you located in China, you can use taobao registry to speed up | ||||
| # RUN pnpm install --frozen-lockfile --registry https://registry.npmmirror.com/ | # RUN pnpm install --frozen-lockfile --registry https://registry.npmmirror.com/ | ||||
| "name": "dify-web", | "name": "dify-web", | ||||
| "version": "1.7.2", | "version": "1.7.2", | ||||
| "private": true, | "private": true, | ||||
| "packageManager": "pnpm@10.14.0", | |||||
| "engines": { | "engines": { | ||||
| "node": ">=v22.11.0" | "node": ">=v22.11.0" | ||||
| }, | }, |