Skip to content

Commit 5f4a12b

Browse files
committed
2 parents 7844666 + 5a6ccc2 commit 5f4a12b

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

.github/workflows/dev.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
run: |
3434
echo "DB_HOST=${{ secrets.DB_HOST }}" >> .env
3535
echo "DB_USER=${{ secrets.DB_USER }}" >> .env
36-
echo "DB_PASSWORD=${{ secrets.DB_PASSWORD }}" >> .env
36+
echo "DB_PASSWORD=${{ secrets.DEV_DB_PASSWORD }}" >> .env
3737
echo "DB_DATABASE=${{ secrets.DEV_DB_DATABASE }}" >> .env
3838
echo "JWT_SECRET=${{ secrets.JWT_SECRET }}" >> .env
3939
echo "JWT_EXPIRATION=${{ secrets.JWT_EXPIRATION }}" >> .env
@@ -68,11 +68,11 @@ jobs:
6868
aws-region: ap-northeast-2
6969

7070
- name: upload to S3
71-
run: aws s3 cp --region ap-northeast-2 ./build.zip s3://oodd-dev-api-bucket/
71+
run: aws s3 cp --region ap-northeast-2 ./build.zip s3://oodd-api-bucket/dev/
7272

7373
- name: deploy with AWS codeDeploy
7474
run: aws deploy create-deployment
7575
--application-name nestjs-app-dev
7676
--deployment-config-name CodeDeployDefault.OneAtATime
7777
--deployment-group-name nestjs-app-dev-group
78-
--s3-location bucket=oodd-dev-api-bucket,bundleType=zip,key=build.zip
78+
--s3-location bucket=oodd-api-bucket,bundleType=zip,key=dev/build.zip

dev-scripts/after-deploy.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
#!/bin/bash
22
REPOSITORY=/home/ubuntu/build-dev
33
APP_NAME=node_app_dev
4-
54
cd $REPOSITORY
5+
export PATH=$PATH:$(npm root -g)
66

77
# Check if the app is already running
8-
if sudo pm2 list | grep $APP_NAME > /dev/null
8+
if pm2 list | grep $APP_NAME > /dev/null
99
then
1010
echo "$APP_NAME is already running. Restarting..."
11-
sudo pm2 delete $APP_NAME
12-
sudo pm2 start dist/main.js --name $APP_NAME
11+
pm2 delete $APP_NAME
12+
pm2 start dist/main.js --name $APP_NAME
1313
else
1414
echo "Starting $APP_NAME"
15-
sudo pm2 start dist/main.js --name $APP_NAME
15+
pm2 start dist/main.js --name $APP_NAME
1616
fi

prod-scripts/after-deploy.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
#!/bin/bash
22
REPOSITORY=/home/ubuntu/build
33
APP_NAME=node_app_prod
4-
54
cd $REPOSITORY
5+
export PATH=$PATH:$(npm root -g)
66

77
# Check if the app is already running
8-
if sudo pm2 list | grep $APP_NAME > /dev/null
8+
if pm2 list | grep $APP_NAME > /dev/null
99
then
1010
echo "$APP_NAME is already running. Restarting..."
11-
sudo pm2 delete $APP_NAME
12-
sudo pm2 start dist/main.js --name $APP_NAME
11+
pm2 delete $APP_NAME
12+
pm2 start dist/main.js --name $APP_NAME
1313
else
1414
echo "Starting $APP_NAME"
15-
sudo pm2 start dist/main.js --name $APP_NAME
15+
pm2 start dist/main.js --name $APP_NAME
1616
fi

0 commit comments

Comments
 (0)