Fix Gitea gateway build and deploy workflow
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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; \
|
||||
|
||||
Reference in New Issue
Block a user