From 6399614d468f3974db77697ecd81b1af1a9ba4f4 Mon Sep 17 00:00:00 2001 From: John Craft Date: Mon, 23 Oct 2023 22:46:57 -0700 Subject: [PATCH] Run Sequelize --- .github/workflows/test-migration.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-migration.yml b/.github/workflows/test-migration.yml index a38d61b..9fc90cb 100644 --- a/.github/workflows/test-migration.yml +++ b/.github/workflows/test-migration.yml @@ -11,6 +11,8 @@ jobs: env: GCP_PROEJCT_ID: "database-migration-anonymized" DB_HOST: "users-db" + POSTGRES_PASSWORD: ${DB_PASSWORD:-dMVZFeBWLOzYRV71} + POSTGRES_DB: "postgres" steps: - name: Checkout code @@ -36,9 +38,6 @@ jobs: docker pull gcr.io/$GCP_PROEJCT_ID/$DB_HOST:latest - name: Start PostgreSQL container - env: - POSTGRES_PASSWORD: ${DB_PASSWORD:-dMVZFeBWLOzYRV71} - POSTGRES_DB: "postgres" run: | docker run -d --name $DB_HOST -e POSTGRES_PASSWORD=$DB_PASSWORD: -e POSTGRES_DB=$POSTGRES_DB -p 5432:5432 gcr.io/$GCP_PROEJCT_ID/$DB_HOST:latest @@ -55,9 +54,11 @@ jobs: sleep 10 done - # - name: Run Sequelize migrations - # run: | - # npx sequelize-cli db:migrate --config path-to-your-sequelize-config + - name: Run Sequelize migrations + env: + DATABASE_URL: postgres://$DB_USERNAME:$POSTGRES_PASSWORD@$DB_HOST:5432/$POSTGRES_DB + run: | + npx sequelize-cli db:migrate - name: Cleanup run: docker stop $DB_HOST