Skip to content

Commit

Permalink
chore: udpate deploy production config (#221)
Browse files Browse the repository at this point in the history
  • Loading branch information
wielopolski authored Nov 8, 2024
1 parent 8bc779c commit 68e882e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
9 changes: 1 addition & 8 deletions .github/workflows/deploy-api-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,11 @@ jobs:
ECS_CLUSTER: ${{ secrets.AWS_ECS_CLUSTER }}
ECS_SERVICE: ${{ secrets.AWS_ECS_SERVICE }}
DOCKER_IMAGE: ${{ secrets.AWS_ECR_REGISTRY }}:${{ github.sha }}
run: selleo aws ecs deploy --region $AWS_REGION --cluster $ECS_CLUSTER --service $ECS_SERVICE --docker-image $DOCKER_IMAGE --one-off migrate --one-off seed
run: selleo aws ecs deploy --region $AWS_REGION --cluster $ECS_CLUSTER --service $ECS_SERVICE --docker-image $DOCKER_IMAGE --one-off migrate

- name: ECS Run migrations
env:
AWS_REGION: ${{ secrets.AWS_REGION }}
ECS_CLUSTER: ${{ secrets.AWS_ECS_CLUSTER }}
ECS_SERVICE: ${{ secrets.AWS_ECS_SERVICE }}
run: selleo aws ecs run --region $AWS_REGION --cluster $ECS_CLUSTER --service $ECS_SERVICE --one-off migrate

- name: ECS Run seeds
env:
AWS_REGION: ${{ secrets.AWS_REGION }}
ECS_CLUSTER: ${{ secrets.AWS_ECS_CLUSTER }}
ECS_SERVICE: ${{ secrets.AWS_ECS_SERVICE }}
run: selleo aws ecs run --region $AWS_REGION --cluster $ECS_CLUSTER --service $ECS_SERVICE --one-off seed
5 changes: 4 additions & 1 deletion apps/api/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ elif [ $COMMAND = "migrate" ]; then
elif [ $COMMAND = "seed" ]; then
echo "Running seeds..."
npm run db:seed-prod
elif [ $COMMAND = "truncate-tables" ]; then
echo "Truncating tables..."
npm run db:truncate-tables
else
echo "Usage: entrypoint.sh [server|migrate]"
echo "Usage: entrypoint.sh [server|migrate|seed|truncate-tables]"
exit 1
fi
4 changes: 2 additions & 2 deletions apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"test:e2e:watch": "jest --config ./test/jest-e2e.json --watch",
"db:migrate": "drizzle-kit migrate",
"db:generate": "drizzle-kit generate",
"db:seed": "ts-node -r tsconfig-paths/register ./src/storage/seed/seed.ts",
"db:seed-prod": "node dist/src/seed-prod.js",
"db:seed": "ts-node -r tsconfig-paths/register ./src/seed.ts",
"db:seed-prod": "node dist/src/seed.js",
"db:truncate-tables": "node dist/src/truncateTables.js"
},
"dependencies": {
Expand Down

0 comments on commit 68e882e

Please sign in to comment.