Fix gateway workflow runner selection
Some checks failed
Build and Deploy Gateway / build-and-deploy (push) Failing after 1s

This commit is contained in:
2026-05-09 10:51:23 +03:00
parent d12b0c01fc
commit 3e8925c609
2 changed files with 52 additions and 69 deletions

View File

@@ -11,8 +11,8 @@ env:
SINGBOX_VERSION: 1.12.13
jobs:
build-and-push:
runs-on: lxc-107
build-and-deploy:
runs-on: ubuntu-22.04
steps:
- name: Clone repository
env:
@@ -25,60 +25,15 @@ jobs:
cd repo
git checkout ${{ gitea.sha }}
- name: Build frontend and gateway image
- name: Build on runner 107 and deploy to 111
run: |
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"
echo "Build runner: $(hostname)"
echo "Base image: ${{ env.BASE_IMAGE }}"
echo "Docker context: $(docker context show 2>/dev/null || true)"
docker info 2>/dev/null | sed -n '/HTTP Proxy:/p;/HTTPS Proxy:/p;/Name:/p'
docker image inspect "${{ env.BASE_IMAGE }}" >/dev/null || {
echo "Runtime base image ${{ env.BASE_IMAGE }} is missing on lxc-107."
echo "Seed it once on 107 with: ./scripts/build-runtime-base.sh"
exit 1
}
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login "$REGISTRY_HOST" -u "${{ gitea.actor }}" --password-stdin
DOCKER_BUILDKIT=1 docker build \
--network host \
--pull=false \
--build-arg BASE_IMAGE="${{ env.BASE_IMAGE }}" \
--build-arg SINGBOX_VERSION="${{ env.SINGBOX_VERSION }}" \
--build-arg INSTALL_RUNTIME_DEPS=false \
--build-arg INSTALL_SINGBOX=false \
-t "${IMAGE}:latest" \
-t "${IMAGE}:${{ gitea.sha }}" \
.
docker push "${IMAGE}:latest"
docker push "${IMAGE}:${{ gitea.sha }}"
deploy:
runs-on: lxc-111
needs: build-and-push
steps:
- name: Clone repository
env:
GIT_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
run: |
set -euo pipefail
SERVER_HOST=$(echo "${{ gitea.server_url }}" | sed 's|https\?://||')
rm -rf repo
git clone --depth 2 "http://${{ gitea.actor }}:${GIT_TOKEN}@${SERVER_HOST}/${{ gitea.repository }}.git" repo
cd repo
git checkout ${{ gitea.sha }}
- name: Deploy gateway to LXC 111
run: |
set -euo pipefail
cd repo
REGISTRY_HOST=$(echo "${{ gitea.server_url }}" | sed 's|https\?://||')
IMAGE="${REGISTRY_HOST}/${{ gitea.repository }}/gateway"
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login "$REGISTRY_HOST" -u "${{ gitea.actor }}" --password-stdin
DEPLOY_PATH="${{ env.DEPLOY_PATH }}" GATEWAY_IMAGE="${IMAGE}:${{ gitea.sha }}" bash scripts/deploy-gateway.sh
BUILD_HOST=local \
DEPLOY_HOST=111 \
DEPLOY_PATH="${{ env.DEPLOY_PATH }}" \
BASE_IMAGE="${{ env.BASE_IMAGE }}" \
SINGBOX_VERSION="${{ env.SINGBOX_VERSION }}" \
IMAGE_TAG="${{ gitea.sha }}" \
bash scripts/build-on-107-deploy-111.sh