From 673dab59d231e1658c0fcdca080fcc8a8a41f0cc Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Tue, 13 Jan 2026 17:08:34 +0100 Subject: [PATCH] ci(deploy): prevent docker compose builds in GitHub Actions Switch CI detection to GITHUB_ACTIONS and disable compose builds via INFINITO_NO_BUILD=1. The deploy workflows now rely on pulling the prebuilt CI image instead of triggering local Docker builds. - Remove legacy UP_BUILD handling - Enable --no-build in compose when running in real CI - Keep local/act builds working as before https://chatgpt.com/share/69666e0b-f08c-800f-93fd-611eced4b100 --- .github/workflows/test-deploy-server.yml | 4 ++-- .github/workflows/test-deploy-universal.yml | 4 ++-- .github/workflows/test-deploy-workstation.yml | 5 ++--- Makefile | 17 ++++------------- cli/deploy/test/compose.py | 11 ++++++++--- 5 files changed, 18 insertions(+), 23 deletions(-) diff --git a/.github/workflows/test-deploy-server.yml b/.github/workflows/test-deploy-server.yml index b5fbed8a9a..c877083e1a 100644 --- a/.github/workflows/test-deploy-server.yml +++ b/.github/workflows/test-deploy-server.yml @@ -41,7 +41,7 @@ jobs: shell: bash run: | set -euo pipefail - make up UP_BUILD=0 + make up - name: Discover apps (JSON) id: discover @@ -83,7 +83,7 @@ jobs: shell: bash run: | set -euo pipefail - make up UP_BUILD=0 + make up - name: Deploy app shell: bash diff --git a/.github/workflows/test-deploy-universal.yml b/.github/workflows/test-deploy-universal.yml index 295e4e9f29..9bc070f6f4 100644 --- a/.github/workflows/test-deploy-universal.yml +++ b/.github/workflows/test-deploy-universal.yml @@ -40,7 +40,7 @@ jobs: shell: bash run: | set -euo pipefail - make up UP_BUILD=0 + make up - name: Discover apps (JSON) id: discover @@ -82,7 +82,7 @@ jobs: shell: bash run: | set -euo pipefail - make up UP_BUILD=0 + make up - name: Deploy app shell: bash diff --git a/.github/workflows/test-deploy-workstation.yml b/.github/workflows/test-deploy-workstation.yml index 87ac8d96d3..7ae3391bec 100644 --- a/.github/workflows/test-deploy-workstation.yml +++ b/.github/workflows/test-deploy-workstation.yml @@ -1,4 +1,3 @@ -# .github/workflows/test-deploy-workstation.yml name: Test Infinito.Nexus Deploy (workstation) on: @@ -40,7 +39,7 @@ jobs: shell: bash run: | set -euo pipefail - make up UP_BUILD=0 + make up - name: Discover apps (JSON) id: discover @@ -82,7 +81,7 @@ jobs: shell: bash run: | set -euo pipefail - make up UP_BUILD=0 + make up - name: Deploy app shell: bash diff --git a/Makefile b/Makefile index 7f3655f0ce..083fe56f97 100644 --- a/Makefile +++ b/Makefile @@ -48,14 +48,13 @@ TEST_DEPLOY_TYPE ?= server # Ensure repo root is importable (so module_utils/, filter_plugins/ etc. work) PYTHONPATH ?= . -# Control whether images are built before compose up (default: yes) -UP_BUILD ?= 1 - # Overwrite defaults -ifeq ($(IS_ACT),0) +ifeq ($(GITHUB_ACTIONS),true) # -------- Real GitHub Actions CI -------- INFINITO_PULL_POLICY ?= always INFINITO_IMAGE ?= ghcr.io/$(GITHUB_REPOSITORY_OWNER)/infinito-$(INFINITO_DISTRO):ci-$(GITHUB_SHA) + INFINITO_NO_BUILD ?= 1 + export INFINITO_NO_BUILD export INFINITO_PULL_POLICY export INFINITO_IMAGE endif @@ -100,15 +99,7 @@ down: @INFINITO_DISTRO="$(INFINITO_DISTRO)" docker compose --profile ci down --remove-orphans -v up: -ifeq ($(UP_BUILD),1) - @$(MAKE) build-missing -else - @echo ">>> Skipping local image build (UP_BUILD=0)" -endif - python3 -m cli.deploy.test.up - -up-local: - @$(MAKE) up UP_BUILD=1 + python3 -m cli.deploy.test.up list: @echo "Generating the roles list" diff --git a/cli/deploy/test/compose.py b/cli/deploy/test/compose.py index 0b8e3ac6ff..c604af350b 100644 --- a/cli/deploy/test/compose.py +++ b/cli/deploy/test/compose.py @@ -66,15 +66,20 @@ class Compose: def up(self, *, run_init: bool = True) -> None: print(">>> Starting compose stack (coredns + infinito)") - self.run(["up", "-d", "coredns", "infinito"], check=True) + + no_build = os.environ.get("INFINITO_NO_BUILD", "0") == "1" + args = ["up", "-d"] + if no_build: + args.append("--no-build") + args += ["coredns", "infinito"] + + self.run(args, check=True) print(">>> Waiting for systemd to be ready") self.wait_for_systemd_ready() if run_init: print(">>> Running infinito entry.sh init") - # Reuse the same init entrypoint logic as the image does. - # Use sh -lc so PATH/env/profile are consistent and we can pass args. self.exec( ["sh", "-lc", "/opt/src/infinito/scripts/docker/entry.sh true"], workdir="/opt/src/infinito",