From f02c51870c9e8b01a54a80442342ade96f728ce9 Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Wed, 21 Jan 2026 21:41:33 +0000 Subject: [PATCH] readded postgres deployment --- .github/workflows/stripe-to-invoice.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/stripe-to-invoice.yml b/.github/workflows/stripe-to-invoice.yml index b2ac901..3811b7c 100644 --- a/.github/workflows/stripe-to-invoice.yml +++ b/.github/workflows/stripe-to-invoice.yml @@ -155,9 +155,11 @@ jobs: if [[ "$ENV" == "prod" ]]; then USER="$PROD_POSTGRES_USER" PASS="$PROD_POSTGRES_PASSWORD" + RUNTIME_SECRET=postgres-prod else USER="$DEV_POSTGRES_USER" PASS="$DEV_POSTGRES_PASSWORD" + RUNTIME_SECRET=postgres-dev fi DATABASE_URL="postgres://${USER}:${PASS}@${POSTGRES_HOST}:5432/${POSTGRES_DB}?sslmode=disable" @@ -247,6 +249,21 @@ jobs: echo "POSTGRES_DB=stripe_invoice" >> $GITHUB_ENV fi + - name: Wait for Postgres TCP + run: | + set -e + for i in {1..30}; do + if nc -z "$POSTGRES_HOST" 5432; then + echo "Postgres is accepting connections" + exit 0 + fi + echo "Waiting for Postgres ($i/30)..." + sleep 5 + done + echo "Postgres never became ready" + exit 1 + + - name: Run migrations run: | set -e