fix: require cloud chart sync and deployed revision
This commit is contained in:
@@ -44,6 +44,8 @@ jobs:
|
||||
frontend/supabase/migrations/20260718050000_profiles_service_role_upsert_grants.sql \
|
||||
frontend/supabase/migrations/20260718070000_profiles_service_role_upsert_id.sql \
|
||||
frontend/supabase/migrations/20260718080000_profiles_service_role_account_upsert_selects.sql \
|
||||
frontend/supabase/migrations/20260718100000_repair_missing_chart_profiles.sql \
|
||||
frontend/supabase/migrations/20260718103000_profile_birth_time_declaration_grants.sql \
|
||||
"$DEPLOY_USER@$DEPLOY_HOST:$DEPLOY_PATH/tmp/profile-migrations/"
|
||||
|
||||
- name: Apply profile migrations using VPS database URL
|
||||
@@ -70,7 +72,9 @@ jobs:
|
||||
tmp/profile-migrations/20260718020000_profiles_service_role_upsert_grants.sql \
|
||||
tmp/profile-migrations/20260718050000_profiles_service_role_upsert_grants.sql \
|
||||
tmp/profile-migrations/20260718070000_profiles_service_role_upsert_id.sql \
|
||||
tmp/profile-migrations/20260718080000_profiles_service_role_account_upsert_selects.sql
|
||||
tmp/profile-migrations/20260718080000_profiles_service_role_account_upsert_selects.sql \
|
||||
tmp/profile-migrations/20260718100000_repair_missing_chart_profiles.sql \
|
||||
tmp/profile-migrations/20260718103000_profile_birth_time_declaration_grants.sql
|
||||
do
|
||||
echo "applying $(basename "$SQL_FILE")"
|
||||
cat "$SQL_FILE" | docker run --rm -i postgres:16-alpine \
|
||||
|
||||
@@ -64,9 +64,18 @@ jobs:
|
||||
"cd '$DEPLOY_PATH' && GITHUB_SHA='$DEPLOY_GIT_SHA' docker compose --env-file .env.production -f deploy/docker-compose.server.yml up -d --build --remove-orphans"
|
||||
|
||||
- name: Verify production
|
||||
env:
|
||||
DEPLOY_GIT_SHA: ${{ github.event.workflow_run.head_sha || github.sha }}
|
||||
run: |
|
||||
curl --fail --silent --show-error --retry 12 --retry-delay 5 https://jyotisha.chat/login >/dev/null
|
||||
test "$(curl --silent --output /dev/null --write-out '%{http_code}' https://jyotisha.chat/api/account)" = "401"
|
||||
deployed_sha=""
|
||||
for attempt in $(seq 1 24); do
|
||||
deployed_sha="$(curl --fail --silent --show-error https://jyotisha.chat/api/health | python3 -c 'import json, sys; print(json.load(sys.stdin).get("deployment", {}).get("gitCommit", ""))')" || deployed_sha=""
|
||||
[ "$deployed_sha" = "$DEPLOY_GIT_SHA" ] && break
|
||||
sleep 5
|
||||
done
|
||||
test "$deployed_sha" = "$DEPLOY_GIT_SHA" || { echo "Production revision did not converge: expected $DEPLOY_GIT_SHA, got ${deployed_sha:-empty}" >&2; exit 1; }
|
||||
ssh -i ~/.ssh/jyotisha-production -p "$DEPLOY_PORT" \
|
||||
-o BatchMode=yes -o IdentitiesOnly=yes -o ServerAliveInterval=30 -o ServerAliveCountMax=20 \
|
||||
"$DEPLOY_USER@$DEPLOY_HOST" \
|
||||
|
||||
Reference in New Issue
Block a user