mirror of
https://gitcode.com/ageerle/ruoyi-ai.git
synced 2026-09-13 00:14:59 +00:00
fix: allow frontend dependency builds in image workflow
This commit is contained in:
30
.github/workflows/publish-images.yml
vendored
30
.github/workflows/publish-images.yml
vendored
@@ -4,15 +4,21 @@ on:
|
|||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- 'v*.*.*'
|
- 'v*.*.*'
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
release_tag:
|
||||||
|
description: Release tag to rebuild
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: publish-images-${{ github.ref_name }}
|
group: publish-images-${{ inputs.release_tag || github.ref_name }}
|
||||||
cancel-in-progress: false
|
cancel-in-progress: false
|
||||||
|
|
||||||
env:
|
env:
|
||||||
REGISTRY: ghcr.io
|
REGISTRY: ghcr.io
|
||||||
IMAGE_OWNER: ${{ github.repository_owner }}
|
IMAGE_OWNER: ${{ github.repository_owner }}
|
||||||
RELEASE_TAG: ${{ github.ref_name }}
|
RELEASE_TAG: ${{ inputs.release_tag || github.ref_name }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish:
|
publish:
|
||||||
@@ -70,6 +76,26 @@ jobs:
|
|||||||
path: build/ruoyi-web
|
path: build/ruoyi-web
|
||||||
fetch-depth: 1
|
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
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user