From 9ae49f8797d534eb304db66feabd913fdbc5a756 Mon Sep 17 00:00:00 2001 From: ageerle Date: Tue, 4 Aug 2026 15:30:34 +0800 Subject: [PATCH] fix: allow frontend dependency builds in image workflow --- .github/workflows/publish-images.yml | 30 ++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-images.yml b/.github/workflows/publish-images.yml index 02074d9c..b626e3f6 100644 --- a/.github/workflows/publish-images.yml +++ b/.github/workflows/publish-images.yml @@ -4,15 +4,21 @@ on: push: tags: - 'v*.*.*' + workflow_dispatch: + inputs: + release_tag: + description: Release tag to rebuild + required: true + type: string concurrency: - group: publish-images-${{ github.ref_name }} + group: publish-images-${{ inputs.release_tag || github.ref_name }} cancel-in-progress: false env: REGISTRY: ghcr.io IMAGE_OWNER: ${{ github.repository_owner }} - RELEASE_TAG: ${{ github.ref_name }} + RELEASE_TAG: ${{ inputs.release_tag || github.ref_name }} jobs: publish: @@ -70,6 +76,26 @@ jobs: path: build/ruoyi-web fetch-depth: 1 + - name: Configure frontend dependency builds + if: matrix.source == 'admin' || matrix.source == 'web' + shell: bash + run: | + python3 - "${{ matrix.dockerfile }}" <<'PY' + from pathlib import Path + import sys + + dockerfile = Path(sys.argv[1]) + content = dockerfile.read_text() + marker = "pnpm install --frozen-lockfile" + replacement = ( + "pnpm install --frozen-lockfile " + "--config.dangerously-allow-all-builds=true" + ) + if marker not in content: + raise SystemExit(f"pnpm install command not found in {dockerfile}") + dockerfile.write_text(content.replace(marker, replacement, 1)) + PY + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3