From 6df8c525ef15610e43e5109e4f3e95599748a12c Mon Sep 17 00:00:00 2001 From: Dmitriy Petrov Date: Sat, 9 May 2026 11:10:16 +0300 Subject: [PATCH] Fix Gitea gateway build and deploy workflow --- .gitea/workflows/gateway-build.yml | 18 ++++++++++++++---- Dockerfile.runtime-base | 2 +- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/gateway-build.yml b/.gitea/workflows/gateway-build.yml index deda33e..e1bd9ba 100644 --- a/.gitea/workflows/gateway-build.yml +++ b/.gitea/workflows/gateway-build.yml @@ -31,9 +31,6 @@ jobs: set -euo pipefail cd repo - npm ci --no-audit --no-fund - npm run build - REGISTRY_HOST=$(echo "${{ gitea.server_url }}" | sed 's|https\?://||') IMAGE="${REGISTRY_HOST}/${{ gitea.repository }}/gateway" @@ -50,6 +47,19 @@ jobs: ./scripts/build-runtime-base.sh fi + if command -v npm >/dev/null 2>&1; then + npm ci --no-audit --no-fund + npm run build + else + echo "Host npm not found; building frontend inside ${{ env.BASE_IMAGE }}" + docker run --rm \ + --network host \ + -v "$PWD:/work" \ + -w /work \ + "${{ env.BASE_IMAGE }}" \ + sh -lc 'npm ci --no-audit --no-fund && npm run build' + fi + echo "${{ secrets.REGISTRY_TOKEN }}" | docker login "$REGISTRY_HOST" -u "${{ gitea.actor }}" --password-stdin DOCKER_BUILDKIT=1 docker build \ --network host \ @@ -65,7 +75,7 @@ jobs: docker push "${IMAGE}:${{ gitea.sha }}" deploy: - runs-on: lxc-113 + runs-on: lxc-111 needs: build-and-push steps: - name: Clone repository diff --git a/Dockerfile.runtime-base b/Dockerfile.runtime-base index 5a08b53..523f047 100644 --- a/Dockerfile.runtime-base +++ b/Dockerfile.runtime-base @@ -12,7 +12,7 @@ RUN export http_proxy="${http_proxy:-${HTTP_PROXY:-}}" \ && export https_proxy="${https_proxy:-${HTTPS_PROXY:-}}" \ && export no_proxy="${no_proxy:-${NO_PROXY:-}}" \ && apt-get update \ - && apt-get install -y --no-install-recommends ca-certificates curl iptables ipset iproute2 nodejs dumb-init \ + && apt-get install -y --no-install-recommends ca-certificates curl iptables ipset iproute2 nodejs npm dumb-init \ && rm -rf /var/lib/apt/lists/* RUN set -eux; \