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