readded postgres deployment
This commit is contained in:
parent
c6cb804a05
commit
f02c51870c
1 changed files with 17 additions and 0 deletions
17
.github/workflows/stripe-to-invoice.yml
vendored
17
.github/workflows/stripe-to-invoice.yml
vendored
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue