Fix Gitea gateway build and deploy workflow
Some checks failed
Build and Deploy Gateway / build-and-push (push) Failing after 0s
Build and Deploy Gateway / deploy (push) Has been skipped

This commit is contained in:
2026-05-09 11:10:16 +03:00
parent f264ce4a2f
commit 6df8c525ef
2 changed files with 15 additions and 5 deletions

View File

@@ -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

View File

@@ -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; \