From 8efa574b76b7fe4d377dbf38c3a414ab36d0911e Mon Sep 17 00:00:00 2001 From: Esdras Renan Date: Thu, 9 Oct 2025 17:57:18 -0300 Subject: [PATCH] ci(stack): carregar .env antes do docker stack deploy (envsubst)\n\n- Usa set -o allexport && source .env para popular MACHINE_PROVISIONING_SECRET e afins.\n- Garante substituicao de variaveis no stack.yml em producao. --- .github/workflows/ci-cd-web-desktop.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci-cd-web-desktop.yml b/.github/workflows/ci-cd-web-desktop.yml index 322eb10..c04b064 100644 --- a/.github/workflows/ci-cd-web-desktop.yml +++ b/.github/workflows/ci-cd-web-desktop.yml @@ -158,6 +158,10 @@ jobs: - name: Swarm deploy (stack.yml) run: | cd "$EFFECTIVE_APP_DIR" + # Exporta variáveis do .env para substituição no stack (ex.: MACHINE_PROVISIONING_SECRET) + set -o allexport + if [ -f .env ]; then . ./.env; fi + set +o allexport APP_DIR="$EFFECTIVE_APP_DIR" RELEASE_SHA=${{ github.sha }} docker stack deploy --with-registry-auth -c stack.yml sistema - name: Restart web service with new code